!function (e, t) {
  "object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.websdk = t() : e.websdk = t();
}(window, function () {
  return function (e) {
    var t = {};

    function r(i) {
      if (t[i]) return t[i].exports;
      var o = t[i] = {
        i: i,
        l: !1,
        exports: {}
      };
      return e[i].call(o.exports, o, o.exports, r), o.l = !0, o.exports;
    }

    return r.m = e, r.c = t, r.d = function (e, t, i) {
      r.o(e, t) || Object.defineProperty(e, t, {
        enumerable: !0,
        get: i
      });
    }, r.r = function (e) {
      "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
        value: "Module"
      }), Object.defineProperty(e, "__esModule", {
        value: !0
      });
    }, r.t = function (e, t) {
      if (1 & t && (e = r(e)), 8 & t) return e;
      if (4 & t && "object" == typeof e && e && e.__esModule) return e;
      var i = Object.create(null);
      if (r.r(i), Object.defineProperty(i, "default", {
        enumerable: !0,
        value: e
      }), 2 & t && "string" != typeof e) for (var o in e) r.d(i, o, function (t) {
        return e[t];
      }.bind(null, o));
      return i;
    }, r.n = function (e) {
      var t = e && e.__esModule ? function () {
        return e.default;
      } : function () {
        return e;
      };
      return r.d(t, "a", t), t;
    }, r.o = function (e, t) {
      return Object.prototype.hasOwnProperty.call(e, t);
    }, r.p = "/Users/zhangdong/code/kefu-fe/websdk/packages/sdk", r(r.s = 152);
  }([, function (e, t, r) {
    "use strict";

    e.exports = function (e) {
      return e && e.__esModule ? e : {
        default: e
      };
    };
  }, function (e, t, r) {
    "use strict";

    var i = r(1)(r(6)),
        o = e.exports,
        n = r(90);
    o.LongBits = r(61), o.Long = r(154), o.pool = r(155), o.float = r(156), o.asPromise = r(157), o.EventEmitter = r(158), o.path = r(159), o.base64 = r(91), o.utf8 = r(37), o.compareFieldsById = function (e, t) {
      return e.id - t.id;
    }, o.toArray = function (e) {
      if (e) {
        for (var t = Object.keys(e), r = new Array(t.length), i = 0; i < t.length;) r[i] = e[t[i++]];

        return r;
      }

      return [];
    }, o.toObject = function (e) {
      for (var t = {}, r = 0; r < e.length;) {
        var i = e[r++],
            o = e[r++];
        void 0 !== o && (t[i] = o);
      }

      return t;
    }, o.isString = function (e) {
      return "string" == typeof e || e instanceof String;
    };
    o.isReserved = function (e) {
      return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e);
    }, o.isObject = function (e) {
      return e && "object" === (0, i.default)(e);
    }, o.Array = "undefined" != typeof Uint8Array ? Uint8Array : Array, o.oneOfGetter = function (e) {
      for (var t = {}, r = 0; r < e.length; ++r) t[e[r]] = 1;

      return function () {
        for (var e = Object.keys(this), r = e.length - 1; r > -1; --r) if (1 === t[e[r]] && void 0 !== this[e[r]] && null !== this[e[r]]) return e[r];
      };
    }, o.oneOfSetter = function (e) {
      return function (t) {
        for (var r = 0; r < e.length; ++r) e[r] !== t && delete this[e[r]];
      };
    }, o.merge = function (e, t, r) {
      for (var i = Object.keys(t), o = 0; o < i.length; ++o) void 0 !== e[i[o]] && r || (e[i[o]] = t[i[o]]);

      return e;
    }, o.decorateType = function (e, t) {
      if (e.$type) return t && e.$type.name !== t && (o.decorateRoot.remove(e.$type), e.$type.name = t, o.decorateRoot.add(e.$type)), e.$type;
      Type || (Type = r(21));
      var i = new Type(t || e.name);
      return o.decorateRoot.add(i), i.ctor = e, Object.defineProperty(e, "$type", {
        value: i,
        enumerable: !1
      }), Object.defineProperty(e.prototype, "$type", {
        value: i,
        enumerable: !1
      }), i;
    }, o.emptyArray = Object.freeze ? Object.freeze([]) : [], o.emptyObject = Object.freeze ? Object.freeze({}) : {}, o.longToHash = function (e) {
      return e ? o.LongBits.from(e).toHash() : o.LongBits.zeroHash;
    }, o.copy = function (e) {
      if ("object" != (0, i.default)(e)) return e;
      var t = {};

      for (var r in e) t[r] = e[r];

      return t;
    }, o.deepCopy = function e(t) {
      if ("object" != (0, i.default)(t)) return t;
      var r = {};

      for (var o in t) r[o] = e(t[o]);

      return r;
    }, o.ProtocolError = function (e) {
      function t(e, r) {
        if (!(this instanceof t)) return new t(e, r);
        Object.defineProperty(this, "message", {
          get: function () {
            return e;
          }
        }), Error.captureStackTrace ? Error.captureStackTrace(this, t) : Object.defineProperty(this, "stack", {
          value: new Error().stack || ""
        }), r && merge(this, r);
      }

      return (t.prototype = Object.create(Error.prototype)).constructor = t, Object.defineProperty(t.prototype, "name", {
        get: function () {
          return e;
        }
      }), t.prototype.toString = function () {
        return this.name + ": " + this.message;
      }, t;
    }, o.toJSONOptions = {
      longs: String,
      enums: String,
      bytes: String,
      json: !0
    }, o.Buffer = null, o.newBuffer = function (e) {
      return "number" == typeof e ? new o.Array(e) : "undefined" == typeof Uint8Array ? e : new Uint8Array(e);
    }, o.stringToBytes = function (e) {
      var t,
          r,
          i = [];
      t = e.length;

      for (var o = 0; o < t; o++) (r = e.charCodeAt(o)) >= 65536 && r <= 1114111 ? (i.push(r >> 18 & 7 | 240), i.push(r >> 12 & 63 | 128), i.push(r >> 6 & 63 | 128), i.push(63 & r | 128)) : r >= 2048 && r <= 65535 ? (i.push(r >> 12 & 15 | 224), i.push(r >> 6 & 63 | 128), i.push(63 & r | 128)) : r >= 128 && r <= 2047 ? (i.push(r >> 6 & 31 | 192), i.push(63 & r | 128)) : i.push(255 & r);

      return i;
    }, o.byteToString = function (e) {
      if ("string" == typeof e) return e;

      for (var t = "", r = e, i = 0; i < r.length; i++) {
        var o = r[i].toString(2),
            n = o.match(/^1+?(?=0)/);

        if (n && 8 == o.length) {
          for (var s = n[0].length, a = r[i].toString(2).slice(7 - s), u = 1; u < s; u++) a += r[u + i].toString(2).slice(2);

          t += String.fromCharCode(parseInt(a, 2)), i += s - 1;
        } else t += String.fromCharCode(r[i]);
      }

      return t;
    }, o.isInteger = Number.isInteger || function (e) {
      return "number" == typeof e && isFinite(e) && Math.floor(e) === e;
    }, Object.defineProperty(o, "decorateRoot", {
      get: function () {
        return n.decorated || (n.decorated = new (r(38))());
      }
    });
  },,,, function (e, t, r) {
    "use strict";

    function i(e) {
      return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
        return typeof e;
      } : function (e) {
        return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
      })(e);
    }

    function o(e) {
      return (o = "function" == typeof Symbol && "symbol" === i(Symbol.iterator) ? function (e) {
        return i(e);
      } : function (e) {
        return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : i(e);
      })(e);
    }

    function n(t) {
      return "function" == typeof Symbol && "symbol" === o(Symbol.iterator) ? e.exports = n = function (e) {
        return o(e);
      } : e.exports = n = function (e) {
        return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : o(e);
      }, n(t);
    }

    e.exports = n;
  }, function (e, t, r) {
    "use strict";

    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.default = void 0;

    var i = function () {
      return {
        WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR: 0,
        WEBIM_CONNCTION_OPEN_ERROR: 1,
        WEBIM_CONNCTION_AUTH_ERROR: 2,
        WEBIM_CONNCTION_OPEN_USERGRID_ERROR: 3,
        WEBIM_CONNCTION_ATTACH_ERROR: 4,
        WEBIM_CONNCTION_ATTACH_USERGRID_ERROR: 5,
        WEBIM_CONNCTION_REOPEN_ERROR: 6,
        WEBIM_CONNCTION_SERVER_CLOSE_ERROR: 7,
        WEBIM_CONNCTION_SERVER_ERROR: 8,
        WEBIM_CONNCTION_IQ_ERROR: 9,
        WEBIM_CONNCTION_USER_REMOVED: 207,
        WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE: 206,
        WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD: 216,
        WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE: 217,
        WEBIM_CONNCTION_PING_ERROR: 10,
        WEBIM_CONNCTION_NOTIFYVERSION_ERROR: 11,
        WEBIM_CONNCTION_GETROSTER_ERROR: 12,
        WEBIM_CONNCTION_CROSSDOMAIN_ERROR: 13,
        WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES: 14,
        WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR: 15,
        WEBIM_CONNCTION_DISCONNECTED: 16,
        WEBIM_CONNCTION_AJAX_ERROR: 17,
        WEBIM_CONNCTION_JOINROOM_ERROR: 18,
        WEBIM_CONNCTION_GETROOM_ERROR: 19,
        WEBIM_CONNCTION_GETROOMINFO_ERROR: 20,
        WEBIM_CONNCTION_GETROOMMEMBER_ERROR: 21,
        WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR: 22,
        WEBIM_CONNCTION_LOAD_CHATROOM_ERROR: 23,
        WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR: 24,
        WEBIM_CONNCTION_JOINCHATROOM_ERROR: 25,
        WEBIM_CONNCTION_QUITCHATROOM_ERROR: 26,
        WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR: 27,
        WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR: 28,
        WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR: 29,
        WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR: 30,
        WEBIM_CONNCTION_CALLBACK_INNER_ERROR: 31,
        WEBIM_CONNCTION_CLIENT_OFFLINE: 32,
        WEBIM_CONNCTION_CLIENT_LOGOUT: 33,
        WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR: 34,
        WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP: 35,
        WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP: 36,
        WEBIM_CONNECTION_ACCEPT_JOIN_GROUP: 37,
        WEBIM_CONNECTION_DECLINE_JOIN_GROUP: 38,
        WEBIM_CONNECTION_CLOSED: 39,
        WEBIM_UPLOADFILE_BROWSER_ERROR: 100,
        WEBIM_UPLOADFILE_ERROR: 101,
        WEBIM_UPLOADFILE_NO_LOGIN: 102,
        WEBIM_UPLOADFILE_NO_FILE: 103,
        WEBIM_DOWNLOADFILE_ERROR: 200,
        WEBIM_DOWNLOADFILE_NO_LOGIN: 201,
        WEBIM_DOWNLOADFILE_BROWSER_ERROR: 202,
        WEBIM_MESSAGE_REC_TEXT: 300,
        WEBIM_MESSAGE_REC_TEXT_ERROR: 301,
        WEBIM_MESSAGE_REC_EMOTION: 302,
        WEBIM_MESSAGE_REC_PHOTO: 303,
        WEBIM_MESSAGE_REC_AUDIO: 304,
        WEBIM_MESSAGE_REC_AUDIO_FILE: 305,
        WEBIM_MESSAGE_REC_VEDIO: 306,
        WEBIM_MESSAGE_REC_VEDIO_FILE: 307,
        WEBIM_MESSAGE_REC_FILE: 308,
        WEBIM_MESSAGE_SED_TEXT: 309,
        WEBIM_MESSAGE_SED_EMOTION: 310,
        WEBIM_MESSAGE_SED_PHOTO: 311,
        WEBIM_MESSAGE_SED_AUDIO: 312,
        WEBIM_MESSAGE_SED_AUDIO_FILE: 313,
        WEBIM_MESSAGE_SED_VEDIO: 314,
        WEBIM_MESSAGE_SED_VEDIO_FILE: 315,
        WEBIM_MESSAGE_SED_FILE: 316,
        WEBIM_MESSAGE_SED_ERROR: 317,
        STATUS_INIT: 400,
        STATUS_DOLOGIN_USERGRID: 401,
        STATUS_DOLOGIN_IM: 402,
        STATUS_OPENED: 403,
        STATUS_CLOSING: 404,
        STATUS_CLOSED: 405,
        STATUS_ERROR: 406,
        GROUP_NOT_EXIST: 605,
        GROUP_NOT_JOINED: 602,
        MESSAGE_RECALL_TIME_LIMIT: 504,
        SERVICE_NOT_ENABLED: 505,
        SERVICE_NOT_ALLOW_MESSAGING: 506,
        SERVER_UNKNOWN_ERROR: 503,
        MESSAGE_INCLUDE_ILLEGAL_CONTENT: 501,
        PERMISSION_DENIED: 603,
        WEBIM_LOAD_MSG_ERROR: 604
      };
    };

    t.default = i;
  }, function (e, t, r) {
    "use strict";

    e.exports = o;
    var i = null;

    try {
      i = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports;
    } catch (e) {}

    function o(e, t, r) {
      this.low = 0 | e, this.high = 0 | t, this.unsigned = !!r;
    }

    function n(e) {
      return !0 === (e && e.__isLong__);
    }

    o.prototype.__isLong__, Object.defineProperty(o.prototype, "__isLong__", {
      value: !0
    }), o.isLong = n;
    var s = {},
        a = {};

    function u(e, t) {
      var r, i, o;
      return t ? (o = 0 <= (e >>>= 0) && e < 256) && (i = a[e]) ? i : (r = l(e, (0 | e) < 0 ? -1 : 0, !0), o && (a[e] = r), r) : (o = -128 <= (e |= 0) && e < 128) && (i = s[e]) ? i : (r = l(e, e < 0 ? -1 : 0, !1), o && (s[e] = r), r);
    }

    function p(e, t) {
      if (isNaN(e)) return t ? _ : v;

      if (t) {
        if (e < 0) return _;
        if (e >= y) return T;
      } else {
        if (e <= -m) return I;
        if (e + 1 >= m) return b;
      }

      return e < 0 ? p(-e, t).neg() : l(e % d | 0, e / d | 0, t);
    }

    function l(e, t, r) {
      return new o(e, t, r);
    }

    o.fromInt = u, o.fromNumber = p, o.fromBits = l;
    var c = Math.pow;

    function h(e, t, r) {
      if (0 === e.length) throw Error("empty string");
      if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e) return v;
      if ("number" == typeof t ? (r = t, t = !1) : t = !!t, (r = r || 10) < 2 || 36 < r) throw RangeError("radix");
      var i;
      if ((i = e.indexOf("-")) > 0) throw Error("interior hyphen");
      if (0 === i) return h(e.substring(1), t, r).neg();

      for (var o = p(c(r, 8)), n = v, s = 0; s < e.length; s += 8) {
        var a = Math.min(8, e.length - s),
            u = parseInt(e.substring(s, s + a), r);

        if (a < 8) {
          var l = p(c(r, a));
          n = n.mul(l).add(p(u));
        } else n = (n = n.mul(o)).add(p(u));
      }

      return n.unsigned = t, n;
    }

    function f(e, t) {
      return "number" == typeof e ? p(e, t) : "string" == typeof e ? h(e, t) : l(e.low, e.high, "boolean" == typeof t ? t : e.unsigned);
    }

    o.fromString = h, o.fromValue = f;
    var d = 4294967296,
        y = d * d,
        m = y / 2,
        g = u(1 << 24),
        v = u(0);
    o.ZERO = v;

    var _ = u(0, !0);

    o.UZERO = _;
    var E = u(1);
    o.ONE = E;
    var O = u(1, !0);
    o.UONE = O;
    var N = u(-1);
    o.NEG_ONE = N;
    var b = l(-1, 2147483647, !1);
    o.MAX_VALUE = b;
    var T = l(-1, -1, !0);
    o.MAX_UNSIGNED_VALUE = T;
    var I = l(0, -2147483648, !1);
    o.MIN_VALUE = I;
    var R = o.prototype;
    R.toInt = function () {
      return this.unsigned ? this.low >>> 0 : this.low;
    }, R.toNumber = function () {
      return this.unsigned ? (this.high >>> 0) * d + (this.low >>> 0) : this.high * d + (this.low >>> 0);
    }, R.toString = function (e) {
      if ((e = e || 10) < 2 || 36 < e) throw RangeError("radix");
      if (this.isZero()) return "0";

      if (this.isNegative()) {
        if (this.eq(I)) {
          var t = p(e),
              r = this.div(t),
              i = r.mul(t).sub(this);
          return r.toString(e) + i.toInt().toString(e);
        }

        return "-" + this.neg().toString(e);
      }

      for (var o = p(c(e, 6), this.unsigned), n = this, s = "";;) {
        var a = n.div(o),
            u = (n.sub(a.mul(o)).toInt() >>> 0).toString(e);
        if ((n = a).isZero()) return u + s;

        for (; u.length < 6;) u = "0" + u;

        s = "" + u + s;
      }
    }, R.getHighBits = function () {
      return this.high;
    }, R.getHighBitsUnsigned = function () {
      return this.high >>> 0;
    }, R.getLowBits = function () {
      return this.low;
    }, R.getLowBitsUnsigned = function () {
      return this.low >>> 0;
    }, R.getNumBitsAbs = function () {
      if (this.isNegative()) return this.eq(I) ? 64 : this.neg().getNumBitsAbs();

      for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--);

      return 0 != this.high ? t + 33 : t + 1;
    }, R.isZero = function () {
      return 0 === this.high && 0 === this.low;
    }, R.eqz = R.isZero, R.isNegative = function () {
      return !this.unsigned && this.high < 0;
    }, R.isPositive = function () {
      return this.unsigned || this.high >= 0;
    }, R.isOdd = function () {
      return 1 == (1 & this.low);
    }, R.isEven = function () {
      return 0 == (1 & this.low);
    }, R.equals = function (e) {
      return n(e) || (e = f(e)), (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low;
    }, R.eq = R.equals, R.notEquals = function (e) {
      return !this.eq(e);
    }, R.neq = R.notEquals, R.ne = R.notEquals, R.lessThan = function (e) {
      return this.comp(e) < 0;
    }, R.lt = R.lessThan, R.lessThanOrEqual = function (e) {
      return this.comp(e) <= 0;
    }, R.lte = R.lessThanOrEqual, R.le = R.lessThanOrEqual, R.greaterThan = function (e) {
      return this.comp(e) > 0;
    }, R.gt = R.greaterThan, R.greaterThanOrEqual = function (e) {
      return this.comp(e) >= 0;
    }, R.gte = R.greaterThanOrEqual, R.ge = R.greaterThanOrEqual, R.compare = function (e) {
      if (n(e) || (e = f(e)), this.eq(e)) return 0;
      var t = this.isNegative(),
          r = e.isNegative();
      return t && !r ? -1 : !t && r ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high === this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1;
    }, R.comp = R.compare, R.negate = function () {
      return !this.unsigned && this.eq(I) ? I : this.not().add(E);
    }, R.neg = R.negate, R.add = function (e) {
      n(e) || (e = f(e));
      var t = this.high >>> 16,
          r = 65535 & this.high,
          i = this.low >>> 16,
          o = 65535 & this.low,
          s = e.high >>> 16,
          a = 65535 & e.high,
          u = e.low >>> 16,
          p = 0,
          c = 0,
          h = 0,
          d = 0;
      return h += (d += o + (65535 & e.low)) >>> 16, c += (h += i + u) >>> 16, p += (c += r + a) >>> 16, p += t + s, l((h &= 65535) << 16 | (d &= 65535), (p &= 65535) << 16 | (c &= 65535), this.unsigned);
    }, R.subtract = function (e) {
      return n(e) || (e = f(e)), this.add(e.neg());
    }, R.sub = R.subtract, R.multiply = function (e) {
      if (this.isZero()) return v;
      if (n(e) || (e = f(e)), i) return l(i.mul(this.low, this.high, e.low, e.high), i.get_high(), this.unsigned);
      if (e.isZero()) return v;
      if (this.eq(I)) return e.isOdd() ? I : v;
      if (e.eq(I)) return this.isOdd() ? I : v;
      if (this.isNegative()) return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
      if (e.isNegative()) return this.mul(e.neg()).neg();
      if (this.lt(g) && e.lt(g)) return p(this.toNumber() * e.toNumber(), this.unsigned);
      var t = this.high >>> 16,
          r = 65535 & this.high,
          o = this.low >>> 16,
          s = 65535 & this.low,
          a = e.high >>> 16,
          u = 65535 & e.high,
          c = e.low >>> 16,
          h = 65535 & e.low,
          d = 0,
          y = 0,
          m = 0,
          _ = 0;
      return m += (_ += s * h) >>> 16, y += (m += o * h) >>> 16, m &= 65535, y += (m += s * c) >>> 16, d += (y += r * h) >>> 16, y &= 65535, d += (y += o * c) >>> 16, y &= 65535, d += (y += s * u) >>> 16, d += t * h + r * c + o * u + s * a, l((m &= 65535) << 16 | (_ &= 65535), (d &= 65535) << 16 | (y &= 65535), this.unsigned);
    }, R.mul = R.multiply, R.divide = function (e) {
      if (n(e) || (e = f(e)), e.isZero()) throw Error("division by zero");
      var t, r, o;
      if (i) return this.unsigned || -2147483648 !== this.high || -1 !== e.low || -1 !== e.high ? l((this.unsigned ? i.div_u : i.div_s)(this.low, this.high, e.low, e.high), i.get_high(), this.unsigned) : this;
      if (this.isZero()) return this.unsigned ? _ : v;

      if (this.unsigned) {
        if (e.unsigned || (e = e.toUnsigned()), e.gt(this)) return _;
        if (e.gt(this.shru(1))) return O;
        o = _;
      } else {
        if (this.eq(I)) return e.eq(E) || e.eq(N) ? I : e.eq(I) ? E : (t = this.shr(1).div(e).shl(1)).eq(v) ? e.isNegative() ? E : N : (r = this.sub(e.mul(t)), o = t.add(r.div(e)));
        if (e.eq(I)) return this.unsigned ? _ : v;
        if (this.isNegative()) return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
        if (e.isNegative()) return this.div(e.neg()).neg();
        o = v;
      }

      for (r = this; r.gte(e);) {
        t = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));

        for (var s = Math.ceil(Math.log(t) / Math.LN2), a = s <= 48 ? 1 : c(2, s - 48), u = p(t), h = u.mul(e); h.isNegative() || h.gt(r);) h = (u = p(t -= a, this.unsigned)).mul(e);

        u.isZero() && (u = E), o = o.add(u), r = r.sub(h);
      }

      return o;
    }, R.div = R.divide, R.modulo = function (e) {
      return n(e) || (e = f(e)), i ? l((this.unsigned ? i.rem_u : i.rem_s)(this.low, this.high, e.low, e.high), i.get_high(), this.unsigned) : this.sub(this.div(e).mul(e));
    }, R.mod = R.modulo, R.rem = R.modulo, R.not = function () {
      return l(~this.low, ~this.high, this.unsigned);
    }, R.and = function (e) {
      return n(e) || (e = f(e)), l(this.low & e.low, this.high & e.high, this.unsigned);
    }, R.or = function (e) {
      return n(e) || (e = f(e)), l(this.low | e.low, this.high | e.high, this.unsigned);
    }, R.xor = function (e) {
      return n(e) || (e = f(e)), l(this.low ^ e.low, this.high ^ e.high, this.unsigned);
    }, R.shiftLeft = function (e) {
      return n(e) && (e = e.toInt()), 0 == (e &= 63) ? this : e < 32 ? l(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : l(0, this.low << e - 32, this.unsigned);
    }, R.shl = R.shiftLeft, R.shiftRight = function (e) {
      return n(e) && (e = e.toInt()), 0 == (e &= 63) ? this : e < 32 ? l(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : l(this.high >> e - 32, this.high >= 0 ? 0 : -1, this.unsigned);
    }, R.shr = R.shiftRight, R.shiftRightUnsigned = function (e) {
      if (n(e) && (e = e.toInt()), 0 === (e &= 63)) return this;
      var t = this.high;
      return e < 32 ? l(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : l(32 === e ? t : t >>> e - 32, 0, this.unsigned);
    }, R.shru = R.shiftRightUnsigned, R.shr_u = R.shiftRightUnsigned, R.toSigned = function () {
      return this.unsigned ? l(this.low, this.high, !1) : this;
    }, R.toUnsigned = function () {
      return this.unsigned ? this : l(this.low, this.high, !0);
    }, R.toBytes = function (e) {
      return e ? this.toBytesLE() : this.toBytesBE();
    }, R.toBytesLE = function () {
      var e = this.high,
          t = this.low;
      return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24];
    }, R.toBytesBE = function () {
      var e = this.high,
          t = this.low;
      return [e >>> 24, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24, t >>> 16 & 255, t >>> 8 & 255, 255 & t];
    }, o.fromBytes = function (e, t, r) {
      return r ? o.fromBytesLE(e, t) : o.fromBytesBE(e, t);
    }, o.fromBytesLE = function (e, t) {
      return new o(e[0] | e[1] << 8 | e[2] << 16 | e[3] << 24, e[4] | e[5] << 8 | e[6] << 16 | e[7] << 24, t);
    }, o.fromBytesBE = function (e, t) {
      return new o(e[4] << 24 | e[5] << 16 | e[6] << 8 | e[7], e[0] << 24 | e[1] << 16 | e[2] << 8 | e[3], t);
    };
  },, function (e, t, r) {
    "use strict";

    var i = r(1)(r(6));
    e.exports = s;
    var o = r(22);
    ((s.prototype = Object.create(o.prototype)).constructor = s).className = "Enum";
    var n = r(31);

    function s(e, t, r, n, s) {
      if (o.call(this, e, r), t && "object" !== (0, i.default)(t)) throw TypeError("values must be an object");
      if (this.valuesById = {}, this.values = Object.create(this.valuesById), this.comment = n, this.comments = s || {}, this.reserved = void 0, t) for (var a = Object.keys(t), u = 0; u < a.length; ++u) "number" == typeof t[a[u]] && (this.valuesById[this.values[a[u]] = t[a[u]]] = a[u]);
    }

    s.fromJSON = function (e, t) {
      var r = new s(e, t.values, t.options, t.comment, t.comments);
      return r.reserved = t.reserved, r;
    }, s.prototype.toJSON = function (e) {
      var t = !!e && Boolean(e.keepComments);
      return util.toObject(["options", this.options, "values", this.values, "reserved", this.reserved && this.reserved.length ? this.reserved : void 0, "comment", t ? this.comment : void 0, "comments", t ? this.comments : void 0]);
    }, s.prototype.add = function (e, t, r) {
      if (!util.isString(e)) throw TypeError("name must be a string");
      if (!util.isInteger(t)) throw TypeError("id must be an integer");
      if (void 0 !== this.values[e]) throw Error("duplicate name '" + e + "' in " + this);
      if (this.isReservedId(t)) throw Error("id " + t + " is reserved in " + this);
      if (this.isReservedName(e)) throw Error("name '" + e + "' is reserved in " + this);

      if (void 0 !== this.valuesById[t]) {
        if (!this.options || !this.options.allow_alias) throw Error("duplicate id " + t + " in " + this);
        this.values[e] = t;
      } else this.valuesById[this.values[e] = t] = e;

      return this.comments[e] = r || null, this;
    }, s.prototype.remove = function (e) {
      if (!util.isString(e)) throw TypeError("name must be a string");
      var t = this.values[e];
      if (null == t) throw Error("name '" + e + "' does not exist in " + this);
      return delete this.valuesById[t], delete this.values[e], delete this.comments[e], this;
    }, s.prototype.isReservedId = function (e) {
      return n.isReservedId(this.reserved, e);
    }, s.prototype.isReservedName = function (e) {
      return n.isReservedName(this.reserved, e);
    };
  },,,,, function (e, t, r) {
    "use strict";

    var i = r(1)(r(6));
    e.exports = l;
    var o,
        n,
        s,
        a,
        u = r(22);
    ((l.prototype = Object.create(u.prototype)).constructor = l).className = "Field";
    var p = /^required|optional|repeated$/;

    function l(e, t, r, i, o, a, l) {
      if (s.isObject(i) ? (l = o, a = i, i = o = void 0) : s.isObject(o) && (l = a, a = o, o = void 0), u.call(this, e, a), !s.isInteger(t) || t < 0) throw TypeError("id must be a non-negative integer");
      if (!s.isString(r)) throw TypeError("type must be a string");
      if (void 0 !== i && !p.test(i = i.toString().toLowerCase())) throw TypeError("rule must be a string rule");
      if (void 0 !== o && !s.isString(o)) throw TypeError("extend must be a string");
      this.rule = i && "optional" !== i ? i : void 0, this.type = r, this.id = t, this.extend = o || void 0, this.required = "required" === i, this.optional = !this.required, this.repeated = "repeated" === i, this.map = !1, this.message = null, this.partOf = null, this.typeDefault = null, this.defaultValue = null, this.long = !!s.Long && void 0 !== n.long[r], this.bytes = "bytes" === r, this.resolvedType = null, this.extensionField = null, this.declaringField = null, this._packed = null, this.comment = l;
    }

    l.fromJSON = function (e, t) {
      return new l(e, t.id, t.type, t.rule, t.extend, t.options, t.comment);
    }, Object.defineProperty(l.prototype, "packed", {
      get: function () {
        return null === this._packed && (this._packed = !1 !== this.getOption("packed")), this._packed;
      }
    }), l.prototype.setOption = function (e, t, r) {
      return "packed" === e && (this._packed = null), u.prototype.setOption.call(this, e, t, r);
    }, l.prototype.toJSON = function (e) {
      var t = !!e && Boolean(e.keepComments);
      return s.toObject(["rule", "optional" !== this.rule && this.rule || void 0, "type", this.type, "id", this.id, "extend", this.extend, "options", this.options, "comment", t ? this.comment : void 0]);
    }, l.prototype.resolve = function () {
      if (this.resolved) return this;
      if (void 0 === (this.typeDefault = n.defaults[this.type]) && (this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type), this.resolvedType instanceof a ? this.typeDefault = null : this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]), this.options && null != this.options.default && (this.typeDefault = this.options.default, this.resolvedType instanceof o && "string" == typeof this.typeDefault && (this.typeDefault = this.resolvedType.values[this.typeDefault])), this.options && (!0 !== this.options.packed && (void 0 === this.options.packed || !this.resolvedType || this.resolvedType instanceof o) || delete this.options.packed, Object.keys(this.options).length || (this.options = void 0)), this.long) this.typeDefault = s.Long.fromNumber(this.typeDefault, "u" === this.type.charAt(0)), Object.freeze && Object.freeze(this.typeDefault);else if (this.bytes && "string" == typeof this.typeDefault) {
        var e;
        s.utf8.write(this.typeDefault, e = s.newBuffer(s.utf8.length(this.typeDefault)), 0), this.typeDefault = e;
      }
      return this.map ? this.defaultValue = s.emptyObject : this.repeated ? this.defaultValue = s.emptyArray : this.defaultValue = this.typeDefault, this.parent instanceof a && (this.parent.ctor.prototype[this.name] = this.defaultValue), u.prototype.resolve.call(this);
    }, l.d = function (e, t, r, o) {
      return "function" == typeof t ? t = s.decorateType(t).name : t && "object" === (0, i.default)(t) && (t = s.decorateEnum(t).name), function (i, n) {
        s.decorateType(i.constructor).add(new l(n, e, t, r, {
          default: o
        }));
      };
    }, l._configure = function () {
      a = r(21), o = r(10), n = r(23), s = r(2);
    };
  },,,,,, function (e, t, r) {
    "use strict";

    e.exports = v;
    var i,
        o,
        n,
        s,
        a,
        u,
        p,
        l,
        c,
        h,
        f,
        d,
        y,
        m,
        g = r(31);

    function v(e, t) {
      g.call(this, e, t), this.fields = {}, this.oneofs = void 0, this.extensions = void 0, this.reserved = void 0, this.group = void 0, this._fieldsById = null, this._fieldsArray = null, this._oneofsArray = null, this._ctor = null;
    }

    function _(e) {
      return e._fieldsById = e._fieldsArray = e._oneofsArray = null, delete e.encode, delete e.decode, delete e.verify, e;
    }

    ((v.prototype = Object.create(g.prototype)).constructor = v).className = "Type", Object.defineProperties(v.prototype, {
      fieldsById: {
        get: function () {
          if (this._fieldsById) return this._fieldsById;
          this._fieldsById = {};

          for (var e = Object.keys(this.fields), t = 0; t < e.length; ++t) {
            var r = this.fields[e[t]],
                i = r.id;
            if (this._fieldsById[i]) throw Error("duplicate id " + i + " in " + this);
            this._fieldsById[i] = r;
          }

          return this._fieldsById;
        }
      },
      fieldsArray: {
        get: function () {
          return this._fieldsArray || (this._fieldsArray = p.toArray(this.fields));
        }
      },
      oneofsArray: {
        get: function () {
          return this._oneofsArray || (this._oneofsArray = p.toArray(this.oneofs));
        }
      },
      ctor: {
        get: function () {
          return this._ctor || (this.ctor = v.generateConstructor(this));
        },
        set: function (e) {
          var t = e.prototype;
          t instanceof n || ((e.prototype = new n()).constructor = e, p.merge(e.prototype, t)), e.$type = e.prototype.$type = this, p.merge(e, n, !0), p.merge(e.prototype, n, !0), this._ctor = e;

          for (var r = 0; r < this.fieldsArray.length; ++r) this._fieldsArray[r].resolve();

          var i = {};

          for (r = 0; r < this.oneofsArray.length; ++r) {
            var o = this._oneofsArray[r].resolve().name,
                s = function (e) {
              for (var t = {}, r = 0; r < e.length; ++r) t[e[r]] = 0;

              return {
                setter: function (r) {
                  if (!(e.indexOf(r) < 0)) {
                    t[r] = 1;

                    for (var i = 0; i < e.length; ++i) e[i] !== r && delete this[e[i]];
                  }
                },
                getter: function () {
                  for (var e = Object.keys(this), r = e.length - 1; r > -1; --r) if (1 === t[e[r]] && void 0 !== this[e[r]] && null !== this[e[r]]) return e[r];
                }
              };
            }(this._oneofsArray[r].oneof);

            i[o] = {
              get: s.getter,
              set: s.setter
            };
          }

          r && Object.defineProperties(e.prototype, i);
        }
      }
    }), v.generateConstructor = function (e) {
      return function (t) {
        for (var r, i = 0; i < e.fieldsArray.length; i++) (r = e._fieldsArray[i]).map ? this[r.name] = {} : r.repeated && (this[r.name] = []);

        if (t) for (var o = Object.keys(t), n = 0; n < o.length; ++n) null != t[o[n]] && (this[o[n]] = t[o[n]]);
      };
    }, v.fromJSON = function (e, t) {
      var r = new v(e, t.options);
      r.extensions = t.extensions, r.reserved = t.reserved;

      for (var n = Object.keys(t.fields), a = 0; a < n.length; ++a) r.add((void 0 !== t.fields[n[a]].keyType ? m.fromJSON : o.fromJSON)(n[a], t.fields[n[a]]));

      if (t.oneofs) for (n = Object.keys(t.oneofs), a = 0; a < n.length; ++a) r.add(s.fromJSON(n[a], t.oneofs[n[a]]));
      if (t.nested) for (n = Object.keys(t.nested), a = 0; a < n.length; ++a) {
        var u = t.nested[n[a]];
        r.add((void 0 !== u.id ? o.fromJSON : void 0 !== u.fields ? v.fromJSON : void 0 !== u.values ? i.fromJSON : void 0 !== u.methods ? f.fromJSON : g.fromJSON)(n[a], u));
      }
      return t.extensions && t.extensions.length && (r.extensions = t.extensions), t.reserved && t.reserved.length && (r.reserved = t.reserved), t.group && (r.group = !0), t.comment && (r.comment = t.comment), r;
    }, v.prototype.toJSON = function (e) {
      var t = g.prototype.toJSON.call(this, e),
          r = !!e && Boolean(e.keepComments);
      return {
        options: t && t.options || void 0,
        oneofs: g.arrayToJSON(this.oneofsArray, e),
        fields: g.arrayToJSON(this.fieldsArray.filter(function (e) {
          return !e.declaringField;
        }), e) || {},
        extensions: this.extensions && this.extensions.length ? this.extensions : void 0,
        reserved: this.reserved && this.reserved.length ? this.reserved : void 0,
        group: this.group || void 0,
        nested: t && t.nested || void 0,
        comment: r ? this.comment : void 0
      };
    }, v.prototype.resolveAll = function () {
      for (var e = this.fieldsArray, t = 0; t < e.length;) e[t++].resolve();

      var r = this.oneofsArray;

      for (t = 0; t < r.length;) r[t++].resolve();

      return g.prototype.resolveAll.call(this);
    }, v.prototype.get = function (e) {
      return this.fields[e] || this.oneofs && this.oneofs[e] || this.nested && this.nested[e] || null;
    }, v.prototype.add = function (e) {
      if (this.get(e.name)) throw Error("duplicate name '" + e.name + "' in " + this);

      if (e instanceof o && void 0 === e.extend) {
        if (this._fieldsById && this._fieldsById[e.id]) throw Error("duplicate id " + e.id + " in " + this);
        if (this.isReservedId(e.id)) throw Error("id " + e.id + " is reserved in " + this);
        if (this.isReservedName(e.name)) throw Error("name '" + e.name + "' is reserved in " + this);
        return e.parent && e.parent.remove(e), this.fields[e.name] = e, e.message = this, e.onAdd(this), _(this);
      }

      return e instanceof s ? (this.oneofs || (this.oneofs = {}), this.oneofs[e.name] = e, e.onAdd(this), _(this)) : g.prototype.add.call(this, e);
    }, v.prototype.remove = function (e) {
      if (e instanceof o && void 0 === e.extend) {
        if (!this.fields || this.fields[e.name] !== e) throw Error(e + " is not a member of " + this);
        return delete this.fields[e.name], e.parent = null, e.onRemove(this), _(this);
      }

      if (e instanceof s) {
        if (!this.oneofs || this.oneofs[e.name] !== e) throw Error(e + " is not a member of " + this);
        return delete this.oneofs[e.name], e.parent = null, e.onRemove(this), _(this);
      }

      return g.prototype.remove.call(this, e);
    }, v.prototype.isReservedId = function (e) {
      return g.isReservedId(this.reserved, e);
    }, v.prototype.isReservedName = function (e) {
      return g.isReservedName(this.reserved, e);
    }, v.prototype.create = function (e) {
      return new this.ctor(e);
    }, v.prototype.setup = function () {
      for (var e = this.fullName, t = [], r = 0; r < this.fieldsArray.length; ++r) t.push(this._fieldsArray[r].resolve().resolvedType);

      this.encode = c(this)({
        Writer: a,
        types: t,
        util: p
      }), this.decode = h(this)({
        Reader: u,
        types: t,
        util: p
      }), this.verify = l(this)({
        types: t,
        util: p
      }), this.fromObject = y.fromObject(this)({
        types: t,
        util: p
      }), this.toObject = y.toObject(this)({
        types: t,
        util: p
      });
      var i = d[e];

      if (i) {
        var o = Object.create(this);
        o.fromObject = this.fromObject, this.fromObject = i.fromObject.bind(o), o.toObject = this.toObject, this.toObject = i.toObject.bind(o);
      }

      return this;
    }, v.prototype.encode = function (e, t) {
      return this.setup().encode(e, t);
    }, v.prototype.encodeDelimited = function (e, t) {
      return this.encode(e, t && t.len ? t.fork() : t).ldelim();
    }, v.prototype.decode = function (e, t) {
      return this.setup().decode(e, t);
    }, v.prototype.decodeDelimited = function (e) {
      return e instanceof u || (e = u.create(e)), this.decode(e, e.uint32());
    }, v.prototype.verify = function (e) {
      return this.setup().verify(e);
    }, v.prototype.fromObject = function (e) {
      return this.setup().fromObject(e);
    }, v.prototype.toObject = function (e, t) {
      return this.setup().toObject(e, t);
    }, v.d = function (e) {
      return function (t) {
        p.decorateType(t, e);
      };
    }, v._configure = function () {
      i = r(10), o = r(15), n = r(64), s = r(32), a = r(89), u = r(96), p = r(2), l = r(97), c = r(98), h = r(99), f = r(39), d = r(100), y = r(101), m = r(62);
    };
  }, function (e, t, r) {
    "use strict";

    var i, o;

    function n(e, t) {
      if (!i.isString(e)) throw TypeError("name must be a string");
      if (t && !i.isObject(t)) throw TypeError("options must be an object");
      this.options = t, this.name = e, this.parent = null, this.resolved = !1, this.comment = null, this.filename = null;
    }

    e.exports = n, n.className = "ReflectionObject", Object.defineProperties(n.prototype, {
      root: {
        get: function () {
          for (var e = this; null !== e.parent;) e = e.parent;

          return e;
        }
      },
      fullName: {
        get: function () {
          for (var e = [this.name], t = this.parent; t;) e.unshift(t.name), t = t.parent;

          return e.join(".");
        }
      }
    }), n.prototype.toJSON = function () {
      throw Error();
    }, n.prototype.onAdd = function (e) {
      this.parent && this.parent !== e && this.parent.remove(this), this.parent = e, this.resolved = !1;
      var t = e.root;
      t instanceof o && t._handleAdd(this);
    }, n.prototype.onRemove = function (e) {
      var t = e.root;
      t instanceof o && t._handleRemove(this), this.parent = null, this.resolved = !1;
    }, n.prototype.resolve = function () {
      return this.resolved || this.root instanceof o && (this.resolved = !0), this;
    }, n.prototype.getOption = function (e) {
      if (this.options) return this.options[e];
    }, n.prototype.setOption = function (e, t, r) {
      return r && this.options && void 0 !== this.options[e] || ((this.options || (this.options = {}))[e] = t), this;
    }, n.prototype.setOptions = function (e, t) {
      if (e) for (var r = Object.keys(e), i = 0; i < r.length; ++i) this.setOption(r[i], e[r[i]], t);
      return this;
    }, n.prototype.toString = function () {
      var e = this.constructor.className,
          t = this.fullName;
      return t.length ? e + " " + t : e;
    }, n._configure = function (e) {
      o = r(38), i = r(2);
    };
  }, function (e, t, r) {
    "use strict";

    var i = e.exports,
        o = r(2),
        n = ["double", "float", "int32", "uint32", "sint32", "fixed32", "sfixed32", "int64", "uint64", "sint64", "fixed64", "sfixed64", "bool", "string", "bytes"];

    function s(e, t) {
      var r = 0,
          i = {};

      for (t |= 0; r < e.length;) i[n[r + t]] = e[r++];

      return i;
    }

    i.basic = s([1, 5, 0, 0, 0, 5, 5, 0, 0, 0, 1, 1, 0, 2, 2]), i.defaults = s([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, !1, "", o.emptyArray, null]), i.long = s([0, 0, 0, 1, 1], 7), i.mapKey = s([0, 0, 0, 5, 5, 0, 0, 0, 1, 1, 0, 2], 2), i.packed = s([1, 5, 0, 0, 0, 5, 5, 0, 0, 0, 1, 1, 0]), i._configure = function () {
      o = r(2);
    };
  },,,,, function (e, t, r) {
    "use strict";

    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.default = void 0;

    var i = function e(t, r) {
      return !this instanceof e ? new e(t) : (this._msg = {}, "function" == typeof e[t] && (e[t].prototype.setGroup = this.setGroup, this._msg = new e[t](r)), this._msg);
    };

    i.prototype.setGroup = function (e) {
      this.body.group = e;
    }, i.prototype._utils = {}, (i.read = function (e) {
      this.id = e, this.type = "read";
    }).prototype.set = function (e) {
      this.body = {
        id: this.id,
        type: this.type,
        ackId: e.id,
        to: e.to,
        msgConfig: e.msgConfig,
        ackContent: e.ackContent
      }, !e.msgConfig && delete this.body.msgConfig, !e.ackContent && delete this.body.ackContent;
    }, (i.delivery = function (e) {
      this.id = e, this.type = "delivery";
    }).prototype.set = function (e) {
      this.body = {
        id: this.id,
        type: this.type,
        ackId: e.ackId,
        to: e.to
      };
    }, (i.txt = function (e) {
      this.id = e, this.type = "txt", this.body = {};
    }).prototype.set = function (e) {
      this.value = e.msg, this.body = {
        id: this.id,
        to: e.to,
        from: e.from,
        msg: this.value,
        type: this.type,
        roomType: e.roomType,
        ext: e.ext || {},
        success: e.success,
        fail: e.fail,
        msgConfig: e.msgConfig
      }, !e.msgConfig && delete this.body.msgConfig, !e.roomType && delete this.body.roomType;
    }, (i.cmd = function (e) {
      this.id = e, this.type = "cmd", this.body = {};
    }).prototype.set = function (e) {
      this.value = "", this.body = {
        id: this.id,
        to: e.to,
        from: e.from,
        action: e.action,
        msg: this.value,
        type: this.type,
        roomType: e.roomType,
        ext: e.ext || {},
        success: e.success
      }, !e.roomType && delete this.body.roomType;
    }, (i.custom = function (e) {
      this.id = e, this.type = "custom", this.body = {};
    }).prototype.set = function (e) {
      this.body = {
        id: this.id,
        to: e.to,
        from: e.from,
        params: e.params,
        customEvent: e.customEvent,
        customExts: e.customExts,
        type: this.type,
        roomType: e.roomType,
        ext: e.ext || {},
        success: e.success
      }, !e.roomType && delete this.body.roomType;
    }, (i.location = function (e) {
      this.id = e, this.type = "loc", this.body = {};
    }).prototype.set = function (e) {
      this.body = {
        id: this.id,
        to: e.to,
        type: this.type,
        roomType: e.roomType,
        addr: e.addr,
        lat: e.lat,
        lng: e.lng,
        ext: e.ext || {}
      };
    }, (i.img = function (e) {
      this.id = e, this.type = "img", this.body = {};
    }).prototype.set = function (e) {
      e.file = e.file || i.prototype._utils.getFileUrl(e.fileInputId), this.value = e.file, this.body = {
        id: this.id,
        file: this.value,
        apiUrl: e.apiUrl,
        to: e.to,
        from: e.from,
        type: this.type,
        ext: e.ext || {},
        roomType: e.roomType,
        onFileUploadError: e.onFileUploadError,
        onFileUploadComplete: e.onFileUploadComplete,
        success: e.success,
        fail: e.fail,
        flashUpload: e.flashUpload,
        width: e.width,
        height: e.height,
        body: e.body,
        uploadError: e.uploadError,
        uploadComplete: e.uploadComplete
      }, !e.roomType && delete this.body.roomType;
    }, (i.audio = function (e) {
      this.id = e, this.type = "audio", this.body = {};
    }).prototype.set = function (e) {
      e.file = e.file || i.prototype._utils.getFileUrl(e.fileInputId), this.value = e.file, this.filename = e.filename || this.value.filename, this.body = {
        id: this.id,
        file: this.value,
        filename: this.filename,
        apiUrl: e.apiUrl,
        to: e.to,
        from: e.from,
        type: this.type,
        ext: e.ext || {},
        length: e.length || 0,
        roomType: e.roomType,
        file_length: e.file_length,
        onFileUploadError: e.onFileUploadError,
        onFileUploadComplete: e.onFileUploadComplete,
        success: e.success,
        fail: e.fail,
        flashUpload: e.flashUpload,
        body: e.body
      }, !e.roomType && delete this.body.roomType;
    }, (i.file = function (e) {
      this.id = e, this.type = "file", this.body = {};
    }).prototype.set = function (e) {
      e.file = e.file || i.prototype._utils.getFileUrl(e.fileInputId), this.value = e.file, this.filename = e.filename || this.value.filename, this.body = {
        id: this.id,
        file: this.value,
        filename: this.filename,
        apiUrl: e.apiUrl,
        to: e.to,
        from: e.from,
        type: this.type,
        ext: e.ext || {},
        roomType: e.roomType,
        onFileUploadError: e.onFileUploadError,
        onFileUploadComplete: e.onFileUploadComplete,
        success: e.success,
        fail: e.fail,
        flashUpload: e.flashUpload,
        body: e.body
      }, !e.roomType && delete this.body.roomType;
    }, (i.video = function (e) {
      this.id = e, this.type = "video", this.body = {};
    }).prototype.set = function (e) {
      e.file = e.file || i.prototype._utils.getFileUrl(e.fileInputId), this.value = e.file, this.filename = e.filename || this.value.filename, this.body = {
        id: this.id,
        file: this.value,
        filename: this.filename,
        apiUrl: e.apiUrl,
        to: e.to,
        from: e.from,
        type: this.type,
        ext: e.ext || {},
        length: e.length || 0,
        roomType: e.roomType,
        file_length: e.file_length,
        onFileUploadError: e.onFileUploadError,
        onFileUploadComplete: e.onFileUploadComplete,
        success: e.success,
        fail: e.fail,
        flashUpload: e.flashUpload,
        body: e.body
      }, !e.roomType && delete this.body.roomType;
    };
    var o = i;
    t.default = o;
  }, function (e, t, r) {
    "use strict";

    var i = r(1);
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.default = void 0;
    var o,
        n = i(r(6));

    function s(e) {
      if (e && "object" == (0, n.default)(e)) {
        var t = [],
            r = this.context.root.lookup("easemob.pb.KeyValue"),
            i = [];

        for (var o in e) {
          var s = r.decode(t);
          s.key = o, "object" == (0, n.default)(e[o]) ? (s.type = 8, s.stringValue = JSON.stringify(e[o])) : "string" == typeof e[o] ? (s.type = 7, s.stringValue = e[o]) : "boolean" == typeof e[o] ? (s.type = 1, s.varintValue = e[o]) : Number.isInteger(e[o]) ? (s.type = 2, s.varintValue = e[o]) : (s.type = 6, s.doubleValue = e[o]), i.push(s);
        }

        return i;
      }
    }

    var a = function (e, t) {
      t.isDebug && console.log("上行消息：", e);
      var r = [],
          i = t.context.root.lookup("easemob.pb.MessageBody.Content").decode(r);
      t.isDebug && console.log("上行contentMessage：", i);
      var o = t.context.root.lookup("easemob.pb.KeyValue"),
          a = [];

      switch (e.type) {
        case "txt":
          i.type = 0, i.text = e.msg;
          break;

        case "img":
          i.type = 1, i.displayName = e.body.filename, i.remotePath = e.body.url, i.secretKey = e.body.secret, i.fileLength = e.body.file_length, i.size = e.body.size, i.thumbnailDisplayName = e.body.filename;
          break;

        case "video":
          i.type = 2, i.displayName = e.body.filename, i.remotePath = e.body.url, i.secretKey = e.body.secret, i.fileLength = e.body.file_length, i.duration = e.body.length, i.thumbnailDisplayName = e.body.filename;
          break;

        case "loc":
          i.type = 3, i.latitude = e.lat, i.longitude = e.lng, i.address = e.addr, i.latitude = e.lat;
          break;

        case "audio":
          i.type = 4, i.displayName = e.body.filename, i.remotePath = e.body.url, i.secretKey = e.body.secret, i.fileLength = e.body.file_length, i.duration = e.body.length, i.size = e.body.size, i.thumbnailDisplayName = e.body.filename;
          break;

        case "file":
          i.type = 5, i.displayName = e.body.filename, i.remotePath = e.body.url, i.secretKey = e.body.secret, i.fileLength = e.body.file_length, i.size = e.body.size, i.thumbnailDisplayName = e.body.filename;
          break;

        case "cmd":
          i.type = 6, i.action = e.action;
          break;

        case "custom":
          i.type = 7, i.params = s.call(t, e.params), i.customEvent = e.customEvent, i.customExts = s.call(t, e.customExts);
      }

      if (e.ext) for (var u in e.ext) {
        var p = o.decode(r);
        p.key = u, "object" == (0, n.default)(e.ext[u]) ? (p.type = 8, p.stringValue = JSON.stringify(e.ext[u])) : "string" == typeof e.ext[u] ? (p.type = 7, p.stringValue = e.ext[u]) : "boolean" == typeof e.ext[u] ? (p.type = 1, p.varintValue = e.ext[u]) : Number.isInteger(e.ext[u]) ? (p.type = 2, p.varintValue = e.ext[u]) : (p.type = 6, p.doubleValue = e.ext[u]), a.push(p);
      }
      var l = t.context.root.lookup("easemob.pb.MessageBody"),
          c = l.decode(r);
      t.isDebug && console.log("上行messageBody：", c), "recall" === e.type ? (c.type = 6, c.from = {
        name: t.context.jid.name
      }, c.to = {
        name: e.to
      }, c.ackMessageId = e.ackId) : "delivery" === e.type ? (c.type = 5, c.from = {
        name: t.context.jid.name
      }, c.to = {
        name: e.to
      }, c.ackMessageId = e.ackId) : "read" === e.type ? (c.type = 4, c.from = {
        name: t.context.jid.name
      }, c.to = {
        name: e.to
      }, c.ackMessageId = e.ackId, e.msgConfig && "groupchat" === e.group && !e.roomType && (c.msgConfig = e.msgConfig, c.ackContent = e.ackContent)) : e.group || e.roomType ? "groupchat" !== e.group || e.roomType ? "groupchat" === e.group && e.roomType && (c.type = 3, c.from = {
        name: t.context.jid.name
      }, c.to = {
        name: e.to
      }) : (c.type = 2, c.from = {
        name: t.context.jid.name
      }, c.to = {
        name: e.to
      }, e.msgConfig && (c.msgConfig = e.msgConfig)) : (c.type = 1, c.from = {
        name: t.context.jid.name
      }, c.to = {
        name: e.to
      }), c.contents = [i], c.ext = a, c = l.encode(c).finish();
      var h = t.context.root.lookup("easemob.pb.Meta").decode(r);

      if (h.id = e.id, "recall" === e.type) {
        h.from = t.context.jid;
        var f = "easemob.com";
        "groupchat" !== e.group && "chatroom" !== e.group || (f = "conference.easemob.com"), h.to = {
          appKey: t.appKey,
          name: e.to,
          domain: f
        };
      } else if ("delivery" === e.type) h.from = t.context.jid, h.to = {
        appKey: t.appKey,
        name: e.to,
        domain: "easemob.com"
      };else if ("read" === e.type) {
        h.from = t.context.jid;
        f = "easemob.com";
        "groupchat" === e.group && (f = "conference.easemob.com"), h.to = {
          appKey: t.appKey,
          name: e.to,
          domain: f
        };
      } else e.group || e.roomType ? "groupchat" !== e.group || e.roomType ? "groupchat" === e.group && e.roomType && (h.from = {
        appKey: t.appKey,
        name: t.user,
        domain: "conference.easemob.com"
      }, h.to = {
        appKey: t.appKey,
        name: e.to,
        domain: "conference.easemob.com"
      }) : (h.from = {
        appKey: t.appKey,
        name: t.user,
        domain: "conference.easemob.com"
      }, h.to = {
        appKey: t.appKey,
        name: e.to,
        domain: "conference.easemob.com"
      }) : (h.from = t.context.jid, h.to = {
        appKey: t.appKey,
        name: e.to,
        domain: "easemob.com"
      });

      h.ns = 1, h.payload = c, t.isDebug && console.log("上行MetaMessage：", h);
      var d = t.context.root.lookup("easemob.pb.CommSyncUL"),
          y = d.decode(r);
      y.meta = h, t.isDebug && console.log("上行commSyncULMessage：", y), y = d.encode(y).finish();
      var m = t.context.root.lookup("easemob.pb.MSync"),
          g = m.decode(r);
      g.version = t.version, g.encryptType = t.encryptType, g.command = 0, g.guid = t.context.jid, g.payload = y, t.isDebug && console.log("上行MSync：", g), g = m.encode(g).finish(), t.sendMSync(g);
    },
        u = function (e, t, r) {
      o = r;
      var i = t || this;
      if (i.msg = e, !e.file) return a(i.msg, t);
      if (i.msg.body && i.msg.body.url) return a(i.msg, t);
      var n = i.msg.onFileUploadComplete;
      i.msg.onFileUploadComplete = function (e) {
        if (e.entities[0]["file-metadata"]) {
          var r = e.entities[0]["file-metadata"]["content-length"];
          i.msg.filetype = e.entities[0]["file-metadata"]["content-type"], r > 204800 && (i.msg.thumbnail = !0);
        }

        i.msg.body = {
          type: i.msg.type || "file",
          url: (t.isHttpDNS ? t.apiUrl + e.uri.substr(e.uri.indexOf("/", 9)) : e.uri) + "/" + e.entities[0].uuid + "?em-redirect=true",
          secret: e.entities[0]["share-secret"],
          filename: i.msg.file.filename || i.msg.filename,
          size: {
            width: i.msg.width || 0,
            height: i.msg.height || 0
          },
          length: i.msg.length || 0,
          file_length: i.msg.ext.file_length || 0,
          filetype: i.msg.filetype || i.msg.file.filetype
        }, a(i.msg, t), n instanceof Function && n(e, i.msg.id);
      }, o.uploadFile.call(t, i.msg);
    };

    t.default = u;
  }, function (e, t, r) {
    "use strict";

    var i = r(1);
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.default = void 0;

    var o = i(r(8)),
        n = i(r(29)),
        s = i(r(7)),
        a = i(r(28)),
        u = i(r(54)),
        p = (0, s.default)(),
        l = {
      0: "TEXT",
      1: "IMAGE",
      2: "VIDEO",
      3: "LOCATION",
      4: "VOICE",
      5: "FILE",
      6: "COMMAND",
      7: "CUSTOM"
    },
        c = function (e, t, r) {
      if (e.delivery && t.from !== t.to) {
        var i = e.getUniqueId(),
            o = new a.default("delivery", i);
        o.set({
          ackId: r,
          to: t.from
        }), (0, n.default)(o.body, e);
      }
    },
        h = function (e) {
      if (e) {
        for (var t = e, r = {}, i = 0; i < t.length; i++) if (8 == t[i].type) r[t[i].key] = JSON.parse(t[i].stringValue);else if (7 == t[i].type) r[t[i].key] = t[i].stringValue;else if (6 == t[i].type) r[t[i].key] = t[i].doubleValue;else if (5 == t[i].type) r[t[i].key] = t[i].floatValue;else if (1 == t[i].type || 2 == t[i].type || 3 == t[i].type || 4 == t[i].type) if (2 == t[i].type) {
          var n = t[i].varintValue,
              s = new o.default(n.low, n.high, n.unsigned).toString();
          r[t[i].key] = Number(s);
        } else r[t[i].key] = t[i].varintValue;

        return r;
      }
    },
        f = function (e, t, r, i) {
      var n = r,
          s = new o.default(e.timestamp.low, e.timestamp.high, e.timestamp.unsigned).toString(),
          a = n.context.root.lookup("easemob.pb.MessageBody").decode(e.payload),
          f = new o.default(e.id.low, e.id.high, e.id.unsigned).toString(),
          d = a.ackMessageId ? new o.default(a.ackMessageId.low, a.ackMessageId.high, a.ackMessageId.unsigned).toString() : "",
          y = null;
      if (r.isDebug && console.log("下行消息：", a), 1 === a.type) y = "chat";else if (2 === a.type) y = "groupchat";else if (3 === a.type) y = "chatroom";else {
        if (4 === a.type) return y = "read_ack", a.msgConfig ? void r.onReadMessage({
          mid: d,
          groupReadCount: a.ext[0] && JSON.parse(a.ext[0].stringValue),
          ackContent: a.ackContent
        }) : void r.onReadMessage({
          mid: d
        });
        if (5 === a.type) return y = "deliver_ack", void r.onDeliverdMessage({
          mid: d
        });
        if (6 === a.type) return y = "recall", void r.onRecallMessage({
          mid: d
        });
      }

      for (var m = 0; m < a.contents.length; m++) {
        var g = {},
            v = t.errorCode > 0,
            _ = t.errorCode,
            E = t.reason,
            O = a.contents[m],
            N = a.from.name,
            b = a.to.name,
            T = {};
        a.ext && (T = h(a.ext));

        try {
          switch (O.type) {
            case 0:
              var I = a.contents[m].text;
              if (!R) var R = {};
              var S = u.default.parseTextMessage(I, R && R.Emoji);
              S.isemoji ? (!(g = {
                id: f,
                type: y,
                contentsType: "EMOJI",
                from: N,
                to: b,
                data: S.body,
                ext: T,
                time: s,
                msgConfig: a.msgConfig
              }).delay && delete g.delay, !g.msgConfig && delete a.msgConfig, g.error = v, g.errorText = E, g.errorCode = _, !i && n.onEmojiMessage(g)) : (!(g = {
                id: f,
                type: y,
                contentsType: l[O.type],
                from: N,
                to: b,
                data: O.text,
                ext: T,
                sourceMsg: O.text,
                time: s,
                msgConfig: a.msgConfig
              }).msgConfig && delete a.msgConfig, g.error = v, g.errorText = E, g.errorCode = _, !i && r.onTextMessage(g));
              break;

            case 1:
              if (O.size) var C = O.size.width || 0,
                  w = O.size.height || 0;
              !(g = {
                id: f,
                type: y,
                contentsType: l[O.type],
                from: N,
                to: b,
                url: O.remotePath && n.apiUrl + O.remotePath.substr(O.remotePath.indexOf("/", 9)),
                secret: O.secretKey,
                filename: O.displayName,
                thumb: O.thumbnailRemotePath,
                thumb_secret: O.thumbnailSecretKey,
                file_length: O.fileLength || "",
                width: C,
                height: w,
                filetype: O.filetype || "",
                accessToken: r.token || "",
                ext: T,
                time: s,
                msgConfig: a.msgConfig
              }).delay && delete g.delay, !g.msgConfig && delete a.msgConfig, g.error = v, g.errorText = E, g.errorCode = _, !i && r.onPictureMessage(g);
              break;

            case 2:
              !(g = {
                id: f,
                type: y,
                contentsType: l[O.type],
                from: N,
                to: b,
                url: O.remotePath && n.apiUrl + O.remotePath.substr(O.remotePath.indexOf("/", 9)),
                secret: O.secretKey,
                filename: O.displayName,
                length: O.duration || "",
                file_length: O.fileLength || "",
                filetype: O.filetype || "",
                accessToken: r.token || "",
                ext: T,
                time: s,
                msgConfig: a.msgConfig
              }).delay && delete g.delay, !g.msgConfig && delete a.msgConfig, g.error = v, g.errorText = E, g.errorCode = _, !i && r.onVideoMessage(g);
              break;

            case 3:
              !(g = {
                id: f,
                type: y,
                contentsType: l[O.type],
                from: N,
                to: b,
                addr: O.address,
                lat: O.latitude,
                lng: O.longitude,
                ext: T,
                time: s,
                msgConfig: a.msgConfig
              }).delay && delete g.delay, !g.msgConfig && delete a.msgConfig, g.error = v, g.errorText = E, g.errorCode = _, !i && r.onLocationMessage(g);
              break;

            case 4:
              !(g = {
                id: f,
                type: y,
                contentsType: l[O.type],
                from: N,
                to: b,
                url: O.remotePath && n.apiUrl + O.remotePath.substr(O.remotePath.indexOf("/", 9)),
                secret: O.secretKey,
                filename: O.displayName,
                file_length: O.fileLength || "",
                accessToken: r.token || "",
                ext: T,
                length: O.duration,
                time: s,
                msgConfig: a.msgConfig
              }).delay && delete g.delay, !g.msgConfig && delete a.msgConfig, g.error = v, g.errorText = E, g.errorCode = _, !i && r.onAudioMessage(g);
              break;

            case 5:
              !(g = {
                id: f,
                type: y,
                contentsType: l[O.type],
                from: N,
                to: b,
                url: O.remotePath && n.apiUrl + O.remotePath.substr(O.remotePath.indexOf("/", 9)),
                secret: O.secretKey,
                filename: O.displayName,
                file_length: O.fileLength,
                accessToken: r.token || "",
                ext: T,
                time: s,
                msgConfig: a.msgConfig
              }).delay && delete g.delay, !g.msgConfig && delete a.msgConfig, g.error = v, g.errorText = E, g.errorCode = _, !i && r.onFileMessage(g);
              break;

            case 6:
              !(g = {
                id: f,
                contentsType: l[O.type],
                from: N,
                to: b,
                action: O.action,
                ext: T,
                time: s,
                msgConfig: a.msgConfig
              }).msgConfig && delete a.msgConfig, g.error = v, g.errorText = E, g.errorCode = _, !i && r.onCmdMessage(g);
              break;

            case 7:
              var A = "",
                  x = "";
              a.contents[0].customExts && (A = h(a.contents[0].customExts)), a.contents[0].params && (x = h(a.contents[0].params)), g = {
                id: f,
                contentsType: l[O.type],
                from: N,
                to: b,
                customEvent: O.customEvent,
                params: x,
                customExts: A,
                ext: T,
                time: s
              }, !i && r.onCustomMessage(g);
          }
        } catch (e) {
          r.onError({
            type: p.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,
            data: e
          });
        }

        if (!i && 1 === a.type && r.delivery && c(r, g, f), i || r.delivery) return g.message_type = y, g;
      }
    };

    t.default = f;
  }, function (e, t, r) {
    "use strict";

    e.exports = l;
    var i,
        o,
        n,
        s,
        a,
        u = r(22);

    function p(e, t) {
      if (e && e.length) {
        for (var r = {}, i = 0; i < e.length; ++i) r[e[i].name] = e[i].toJSON(t);

        return r;
      }
    }

    function l(e, t) {
      u.call(this, e, t), this.nested = void 0, this._nestedArray = null;
    }

    function c(e) {
      return e._nestedArray = null, e;
    }

    ((l.prototype = Object.create(u.prototype)).constructor = l).className = "Namespace", l.fromJSON = function (e, t) {
      return new l(e, t.options).addJSON(t.nested);
    }, l.arrayToJSON = p, l.isReservedId = function (e, t) {
      if (e) for (var r = 0; r < e.length; ++r) if ("string" != typeof e[r] && e[r][0] <= t && e[r][1] >= t) return !0;
      return !1;
    }, l.isReservedName = function (e, t) {
      if (e) for (var r = 0; r < e.length; ++r) if (e[r] === t) return !0;
      return !1;
    }, Object.defineProperty(l.prototype, "nestedArray", {
      get: function () {
        return this._nestedArray || (this._nestedArray = n.toArray(this.nested));
      }
    }), l.prototype.toJSON = function (e) {
      return n.toObject(["options", this.options, "nested", p(this.nestedArray, e)]);
    }, l.prototype.addJSON = function (e) {
      if (e) for (var t, r = Object.keys(e), n = 0; n < r.length; ++n) t = e[r[n]], this.add((void 0 !== t.fields ? s.fromJSON : void 0 !== t.values ? i.fromJSON : void 0 !== t.methods ? a.fromJSON : void 0 !== t.id ? o.fromJSON : l.fromJSON)(r[n], t));
      return this;
    }, l.prototype.get = function (e) {
      return this.nested && this.nested[e] || null;
    }, l.prototype.getEnum = function (e) {
      if (this.nested && this.nested[e] instanceof i) return this.nested[e].values;
      throw Error("no such enum: " + e);
    }, l.prototype.add = function (e) {
      if (!(e instanceof o && void 0 !== e.extend || e instanceof s || e instanceof i || e instanceof a || e instanceof l)) throw TypeError("object must be a valid nested object");

      if (this.nested) {
        var t = this.get(e.name);

        if (t) {
          if (!(t instanceof l && e instanceof l) || t instanceof s || t instanceof a) throw Error("duplicate name '" + e.name + "' in " + this);

          for (var r = t.nestedArray, n = 0; n < r.length; ++n) e.add(r[n]);

          this.remove(t), this.nested || (this.nested = {}), e.setOptions(t.options, !0);
        }
      } else this.nested = {};

      return this.nested[e.name] = e, e.onAdd(this), c(this);
    }, l.prototype.remove = function (e) {
      if (!(e instanceof u)) throw TypeError("object must be a ReflectionObject");
      if (e.parent !== this) throw Error(e + " is not a member of " + this);
      return delete this.nested[e.name], Object.keys(this.nested).length || (this.nested = void 0), e.onRemove(this), c(this);
    }, l.prototype.define = function (e, t) {
      if (n.isString(e)) e = e.split(".");else if (!Array.isArray(e)) throw TypeError("illegal path");
      if (e && e.length && "" === e[0]) throw Error("path must be relative");

      for (var r = this; e.length > 0;) {
        var i = e.shift();

        if (r.nested && r.nested[i]) {
          if (!((r = r.nested[i]) instanceof l)) throw Error("path conflicts with non-namespace objects");
        } else r.add(r = new l(i));
      }

      return t && r.addJSON(t), r;
    }, l.prototype.resolveAll = function () {
      for (var e = this.nestedArray, t = 0; t < e.length;) e[t] instanceof l ? e[t++].resolveAll() : e[t++].resolve();

      return this.resolve();
    }, l.prototype.lookup = function (e, t, r) {
      if ("boolean" == typeof t ? (r = t, t = void 0) : t && !Array.isArray(t) && (t = [t]), n.isString(e) && e.length) {
        if ("." === e) return this.root;
        e = e.split(".");
      } else if (!e.length) return this;

      if ("" === e[0]) return this.root.lookup(e.slice(1), t);
      var i = this.get(e[0]);

      if (i) {
        if (1 === e.length) {
          if (!t || t.indexOf(i.constructor) > -1) return i;
        } else if (i instanceof l && (i = i.lookup(e.slice(1), t, !0))) return i;
      } else for (var o = 0; o < this.nestedArray.length; ++o) if (this._nestedArray[o] instanceof l && (i = this._nestedArray[o].lookup(e, t, !0))) return i;

      return null === this.parent || r ? null : this.parent.lookup(e, t);
    }, l.prototype.lookupType = function (e) {
      var t = this.lookup(e, [s]);
      if (!t) throw Error("no such type: " + e);
      return t;
    }, l.prototype.lookupEnum = function (e) {
      var t = this.lookup(e, [i]);
      if (!t) throw Error("no such Enum '" + e + "' in " + this);
      return t;
    }, l.prototype.lookupTypeOrEnum = function (e) {
      var t = this.lookup(e, [s, i]);
      if (!t) throw Error("no such Type or Enum '" + e + "' in " + this);
      return t;
    }, l.prototype.lookupService = function (e) {
      var t = this.lookup(e, [a]);
      if (!t) throw Error("no such Service '" + e + "' in " + this);
      return t;
    }, l._configure = function () {
      i = r(10), o = r(15), n = r(2), s = r(21), a = r(39);
    };
  }, function (e, t, r) {
    "use strict";

    e.exports = s;
    var i,
        o,
        n = r(22);

    function s(e, t, r, i) {
      if (Array.isArray(t) || (r = t, t = void 0), n.call(this, e, r), void 0 !== t && !Array.isArray(t)) throw TypeError("fieldNames must be an Array");
      this.oneof = t || [], this.fieldsArray = [], this.comment = i;
    }

    function a(e) {
      if (e.parent) for (var t = 0; t < e.fieldsArray.length; ++t) e.fieldsArray[t].parent || e.parent.add(e.fieldsArray[t]);
    }

    ((s.prototype = Object.create(n.prototype)).constructor = s).className = "OneOf", s.fromJSON = function (e, t) {
      return new s(e, t.oneof, t.options, t.comment);
    }, s.prototype.toJSON = function (e) {
      var t = !!e && Boolean(e.keepComments);
      return o.toObject(["options", this.options, "oneof", this.oneof, "comment", t ? this.comment : void 0]);
    }, s.prototype.add = function (e) {
      if (!(e instanceof i)) throw TypeError("field must be a Field");
      return e.parent && e.parent !== this.parent && e.parent.remove(e), this.oneof.push(e.name), this.fieldsArray.push(e), e.partOf = this, a(this), this;
    }, s.prototype.remove = function (e) {
      if (!(e instanceof i)) throw TypeError("field must be a Field");
      var t = this.fieldsArray.indexOf(e);
      if (t < 0) throw Error(e + " is not a member of " + this);
      return this.fieldsArray.splice(t, 1), (t = this.oneof.indexOf(e.name)) > -1 && this.oneof.splice(t, 1), e.partOf = null, this;
    }, s.prototype.onAdd = function (e) {
      n.prototype.onAdd.call(this, e);

      for (var t = 0; t < this.oneof.length; ++t) {
        var r = e.get(this.oneof[t]);
        r && !r.partOf && (r.partOf = this, this.fieldsArray.push(r));
      }

      a(this);
    }, s.prototype.onRemove = function (e) {
      for (var t, r = 0; r < this.fieldsArray.length; ++r) (t = this.fieldsArray[r]).parent && t.parent.remove(t);

      n.prototype.onRemove.call(this, e);
    }, s.d = function () {
      for (var e = new Array(arguments.length), t = 0; t < arguments.length;) e[t] = arguments[t++];

      return function (t, r) {
        o.decorateType(t.constructor).add(new s(r, e)), Object.defineProperty(t, r, {
          get: o.oneOfGetter(e),
          set: o.oneOfSetter(e)
        });
      };
    }, s._configure = function () {
      i = r(15), o = r(2);
    };
  },,, function (e, t, r) {
    "use strict";

    function i(e) {
      return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
        return typeof e;
      } : function (e) {
        return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
      })(e);
    }

    !function () {
      var e = "object" === i(t) && null !== t && "number" != typeof t.nodeType ? t : "undefined" != typeof self ? self : $.global,
          r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

      function o(e) {
        this.message = e;
      }

      o.prototype = new Error(), o.prototype.name = "InvalidCharacterError", e.btoa || (e.btoa = function (e) {
        for (var t, i, n = String(e), s = 0, a = r, u = ""; n.charAt(0 | s) || (a = "=", s % 1); u += a.charAt(63 & t >> 8 - s % 1 * 8)) {
          if ((i = n.charCodeAt(s += 3 / 4)) > 255) throw new o("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");
          t = t << 8 | i;
        }

        return u;
      }), e.atob || (e.atob = function (e) {
        var t = String(e).replace(/[=]+$/, "");
        if (t.length % 4 == 1) throw new o("'atob' failed: The string to be decoded is not correctly encoded.");

        for (var i, n, s = 0, a = 0, u = ""; n = t.charAt(a++); ~n && (i = s % 4 ? 64 * i + n : n, s++ % 4) ? u += String.fromCharCode(255 & i >> (-2 * s & 6)) : 0) n = r.indexOf(n);

        return u;
      });
    }();
  },, function (e, t, r) {
    "use strict";

    var i = e.exports;
    i.length = function (e) {
      for (var t = 0, r = 0, i = 0; i < e.length; ++i) (r = e.charCodeAt(i)) < 128 ? t += 1 : r < 2048 ? t += 2 : 55296 == (64512 & r) && 56320 == (64512 & e.charCodeAt(i + 1)) ? (++i, t += 4) : t += 3;

      return t;
    }, i.read = function (e, t, r) {
      if (r - t < 1) return "";

      for (var i, o = null, n = [], s = 0; t < r;) (i = e[t++]) < 128 ? n[s++] = i : i > 191 && i < 224 ? n[s++] = (31 & i) << 6 | 63 & e[t++] : i > 239 && i < 365 ? (i = ((7 & i) << 18 | (63 & e[t++]) << 12 | (63 & e[t++]) << 6 | 63 & e[t++]) - 65536, n[s++] = 55296 + (i >> 10), n[s++] = 56320 + (1023 & i)) : n[s++] = (15 & i) << 12 | (63 & e[t++]) << 6 | 63 & e[t++], s > 8191 && ((o || (o = [])).push(String.fromCharCode.apply(String, n)), s = 0);

      return o ? (s && o.push(String.fromCharCode.apply(String, n.slice(0, s))), o.join("")) : String.fromCharCode.apply(String, n.slice(0, s));
    }, i.write = function (e, t, r) {
      for (var i, o, n = r, s = 0; s < e.length; ++s) (i = e.charCodeAt(s)) < 128 ? t[r++] = i : i < 2048 ? (t[r++] = i >> 6 | 192, t[r++] = 63 & i | 128) : 55296 == (64512 & i) && 56320 == (64512 & (o = e.charCodeAt(s + 1))) ? (i = 65536 + ((1023 & i) << 10) + (1023 & o), ++s, t[r++] = i >> 18 | 240, t[r++] = i >> 12 & 63 | 128, t[r++] = i >> 6 & 63 | 128, t[r++] = 63 & i | 128) : (t[r++] = i >> 12 | 224, t[r++] = i >> 6 & 63 | 128, t[r++] = 63 & i | 128);

      return r - n;
    };
  }, function (e, t, r) {
    "use strict";

    var i = r(1)(r(6));
    e.exports = h;
    var o = r(31);
    ((h.prototype = Object.create(o.prototype)).constructor = h).className = "Root";
    var n,
        s,
        a,
        u = r(15),
        p = r(10),
        l = r(32),
        c = r(2);

    function h(e) {
      o.call(this, "", e), this.deferred = [], this.files = [], this.names = [];
    }

    function f() {}

    h.fromJSON = function (e, t) {
      return e = "string" == typeof e ? JSON.parse(e) : e, t || (t = new h()), e.options && t.setOptions(e.options), t.addJSON(e.nested);
    }, h.prototype.resolvePath = c.path.resolve, h.prototype.parseFromPbString = function e(t, r, o) {
      "function" == typeof r && (o = r, r = void 0);
      var n = this;
      if (!o) return c.asPromise(e, n, t, r);
      var u = null;
      if ("string" == typeof t) u = JSON.parse(t);else {
        if ("object" !== (0, i.default)(t)) return void console.log("pb格式转化失败");
        u = t;
      }

      function p(e, t) {
        if (o) {
          var r = o;
          o = null, r(e, t);
        }
      }

      function l(e, t) {
        try {
          if (c.isString(t) && "{" === t.charAt(0) && (t = JSON.parse(t)), c.isString(t)) {
            s.filename = e;
            var i,
                o = s(t, n, r),
                a = 0;
            if (o.imports) for (; a < o.imports.length; ++a) h(i = o.imports[a]);

            if (o.weakImports) {
              for (a = 0; a < o.weakImports.length; ++a) i = o.weakImports[a];

              h(i);
            }
          } else n.setOptions(t.options).addJSON(t.nested);
        } catch (e) {
          p(e);
        }

        p(null, n);
      }

      function h(e) {
        n.names.indexOf(e) > -1 || (n.names.push(e), e in a && l(e, a[e]));
      }

      l(u.name, u.pbJsonStr);
    }, h.prototype.load = function e(t, r, i) {
      "function" == typeof r && (i = r, r = void 0);
      var o = this;
      if (!i) return c.asPromise(e, o, t, r);
      var n = i === f;

      function u(e, t) {
        if (i) {
          var r = i;
          if (i = null, n) throw e;
          r(e, t);
        }
      }

      function p(e, t) {
        try {
          if (c.isString(t) && "{" === t.charAt(0) && (t = JSON.parse(t)), c.isString(t)) {
            s.filename = e;
            var i,
                a = s(t, o, r),
                p = 0;
            if (a.imports) for (; p < a.imports.length; ++p) (i = o.resolvePath(e, a.imports[p])) && l(i);
            if (a.weakImports) for (p = 0; p < a.weakImports.length; ++p) (i = o.resolvePath(e, a.weakImports[p])) && l(i, !0);
          } else o.setOptions(t.options).addJSON(t.nested);
        } catch (e) {
          u(e);
        }

        n || h || u(null, o);
      }

      function l(e, t) {
        var r = e.lastIndexOf("google/protobuf/");

        if (r > -1) {
          var s = e.substring(r);
          s in a && (e = s);
        }

        if (!(o.files.indexOf(e) > -1)) if (o.files.push(e), e in a) n ? p(e, a[e]) : (++h, setTimeout(function () {
          --h, p(e, a[e]);
        }));else if (n) {
          var l;

          try {
            l = c.fs.readFileSync(e).toString("utf8");
          } catch (e) {
            return void (t || u(e));
          }

          p(e, l);
        } else ++h, c.fetch(e, function (r, n) {
          --h, i && (r ? t ? h || u(null, o) : u(r) : p(e, n));
        });
      }

      var h = 0;
      c.isString(t) && (t = [t]);

      for (var d, y = 0; y < t.length; ++y) (d = o.resolvePath("", t[y])) && l(d);

      if (n) return o;
      h || u(null, o);
    }, h.prototype.loadSync = function (e, t) {
      if (!c.isNode) throw Error("not supported");
      return this.load(e, t, f);
    }, h.prototype.resolveAll = function () {
      if (this.deferred.length) throw Error("unresolvable extensions: " + this.deferred.map(function (e) {
        return "'extend " + e.extend + "' in " + e.parent.fullName;
      }).join(", "));
      return o.prototype.resolveAll.call(this);
    };
    var d = /^[A-Z]/;

    function y(e, t) {
      var r = t.parent.lookup(t.extend);

      if (r) {
        var i = new u(t.fullName, t.id, t.type, t.rule, void 0, t.options);
        return i.declaringField = t, t.extensionField = i, r.add(i), !0;
      }

      return !1;
    }

    h.prototype._handleAdd = function (e) {
      if (e instanceof u) void 0 === e.extend || e.extensionField || y(0, e) || this.deferred.push(e);else if (e instanceof p) d.test(e.name) && (e.parent[e.name] = e.values);else if (!(e instanceof l)) {
        if (e instanceof n) for (var t = 0; t < this.deferred.length;) y(0, this.deferred[t]) ? this.deferred.splice(t, 1) : ++t;

        for (var r = 0; r < e.nestedArray.length; ++r) this._handleAdd(e._nestedArray[r]);

        d.test(e.name) && (e.parent[e.name] = e);
      }
    }, h.prototype._handleRemove = function (e) {
      if (e instanceof u) {
        if (void 0 !== e.extend) if (e.extensionField) e.extensionField.parent.remove(e.extensionField), e.extensionField = null;else {
          var t = this.deferred.indexOf(e);
          t > -1 && this.deferred.splice(t, 1);
        }
      } else if (e instanceof p) d.test(e.name) && delete e.parent[e.name];else if (e instanceof o) {
        for (var r = 0; r < e.nestedArray.length; ++r) this._handleRemove(e._nestedArray[r]);

        d.test(e.name) && delete e.parent[e.name];
      }
    }, h._configure = function () {
      n = r(21), s = r(92), a = r(95), u = r(15), p = r(10), l = r(32), c = r(2);
    };
  }, function (e, t, r) {
    "use strict";

    e.exports = a;
    var i,
        o,
        n,
        s = r(31);

    function a(e, t) {
      s.call(this, e, t), this.methods = {}, this._methodsArray = null;
    }

    function u(e) {
      return e._methodsArray = null, e;
    }

    ((a.prototype = Object.create(s.prototype)).constructor = a).className = "Service", a.fromJSON = function (e, t) {
      var r = new a(e, t.options);
      if (t.methods) for (var o = Object.keys(t.methods), n = 0; n < o.length; ++n) r.add(i.fromJSON(o[n], t.methods[o[n]]));
      return t.nested && r.addJSON(t.nested), r.comment = t.comment, r;
    }, a.prototype.toJSON = function (e) {
      var t = s.prototype.toJSON.call(this, e),
          r = !!e && Boolean(e.keepComments);
      return o.toObject(["options", t && t.options || void 0, "methods", s.arrayToJSON(this.methodsArray, e) || {}, "nested", t && t.nested || void 0, "comment", r ? this.comment : void 0]);
    }, Object.defineProperty(a.prototype, "methodsArray", {
      get: function () {
        return this._methodsArray || (this._methodsArray = o.toArray(this.methods));
      }
    }), a.prototype.get = function (e) {
      return this.methods[e] || s.prototype.get.call(this, e);
    }, a.prototype.resolveAll = function () {
      for (var e = this.methodsArray, t = 0; t < e.length; ++t) e[t].resolve();

      return s.prototype.resolve.call(this);
    }, a.prototype.add = function (e) {
      if (this.get(e.name)) throw Error("duplicate name '" + e.name + "' in " + this);
      return e instanceof i ? (this.methods[e.name] = e, e.parent = this, u(this)) : s.prototype.add.call(this, e);
    }, a.prototype.remove = function (e) {
      if (e instanceof i) {
        if (this.methods[e.name] !== e) throw Error(e + " is not a member of " + this);
        return delete this.methods[e.name], e.parent = null, u(this);
      }

      return s.prototype.remove.call(this, e);
    }, a.prototype.create = function (e, t, r) {
      for (var i, s = new n.Service(e, t, r), a = 0; a < this.methodsArray.length; ++a) {
        var u = o.lcFirst((i = this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g, "");
        s[u] = o.codegen(["r", "c"], o.isReserved(u) ? u + "_" : u)("return this.rpcCall(m,q,s,r,c)")({
          m: i,
          q: i.resolvedRequestType.ctor,
          s: i.resolvedResponseType.ctor
        });
      }

      return s;
    }, a._configure = function () {
      i = r(63), o = r(2), n = r(94);
    };
  },,,,,,,,,,,,, function (e, t, r) {
    "use strict";

    var i = r(1);
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.default = void 0;

    var o,
        n,
        s = i(r(7)),
        a = i(r(28)),
        u = i(r(53)),
        p = i(r(29)),
        l = i(r(30)),
        c = i(r(55)),
        h = i(r(56)),
        f = i(r(57)),
        d = i(r(8)),
        y = i(r(58)),
        m = {},
        g = (0, s.default)(),
        v = [],
        _ = 1,
        E = function () {},
        O = function e(t) {
      if (!this instanceof e) return new e(t);
      t = t || {};
      this.isDebug = t.isDebug || !1, this.isHttpDNS = t.isHttpDNS || !1, this.isMultiLoginSessions = t.isMultiLoginSessions || !1, this.wait = t.wait || 30, this.retry = t.retry || !1, this.https = t.https && "https:" === location.protocol, this.url = t.url, this.hold = t.hold || 1, this.route = t.route || null, this.inactivity = t.inactivity || 30, this.heartBeatWait = t.heartBeatWait || 4500, this.maxRetries = t.maxRetries || 5, this.isAutoLogin = !1 !== t.isAutoLogin, this.pollingTime = t.pollingTime || 800, this.stropheConn = !1, this.autoReconnectNumMax = t.autoReconnectNumMax || 0, this.autoReconnectNumTotal = 0, this.autoReconnectInterval = t.autoReconnectInterval || 0, this.context = {
        status: g.STATUS_INIT
      }, this.sendQueue = new u.default(), this.intervalId = null, this.apiUrl = t.apiUrl || "", this.isWindowSDK = t.isWindowSDK || !1, this.encrypt = t.encrypt || {
        encrypt: {
          type: "none"
        }
      }, this.delivery = t.delivery || !1, this.appKey = t.appKey || "", this.domain = t.domain || "easemob.com", this.clientResource = "84ff3eba1", this.user = "", this.orgName = "", this.appName = "", this.token = "", this.unSendMsgArr = [], this.dnsArr = ["https://rs.easemob.com", "http://182.92.174.78", "http://112.126.66.111"], this.dnsIndex = 0, this.dnsTotal = this.dnsArr.length, this.restHosts = [], this.restIndex = 0, this.restTotal = 0, this.xmppHosts = [], this.xmppIndex = 0, this.xmppTotal = 0, this.groupOption = {}, this.version = t.version || "3.0.0", this.compressAlgorimth = t.compressAlgorimth || 0, this.userAgent = t.userAgent || 0, this.pov = t.pov || 0, this.command = t.command || 3, this.deviceId = t.deviceId || "webim", this.encryptKey = t.encryptKey || "", this.firstPayload = t.firstPayload || [], this.compressType = t.compressType || [0], this.encryptType = t.encryptType || [0], this.osType = 16;
    };

    O.prototype.registerUser = function (e) {
      this.isHttpDNS ? (this.dnsIndex = 0, this.getHttpDNS(e, "signup")) : this.signup(e);
    }, O.prototype.listen = function (e) {
      this.onOpened = e.onOpened || E, this.onClosed = e.onClosed || E, this.onTextMessage = e.onTextMessage || E, this.onEmojiMessage = e.onEmojiMessage || E, this.onPictureMessage = e.onPictureMessage || E, this.onAudioMessage = e.onAudioMessage || E, this.onVideoMessage = e.onVideoMessage || E, this.onFileMessage = e.onFileMessage || E, this.onLocationMessage = e.onLocationMessage || E, this.onCustomMessage = e.onCustomMessage || E, this.onCmdMessage = e.onCmdMessage || E, this.onStatisticMessage = e.onStatisticMessage || E, this.onPresence = e.onPresence || E, this.onRoster = e.onRoster || E, this.onError = e.onError || E, this.onReceivedMessage = e.onReceivedMessage || E, this.onInviteMessage = e.onInviteMessage || E, this.onDeliverdMessage = e.onDeliveredMessage || E, this.onReadMessage = e.onReadMessage || E, this.onRecallMessage = e.onRecallMessage || E, this.onMutedMessage = e.onMutedMessage || E, this.onOffline = e.onOffline || E, this.onOnline = e.onOnline || E, this.onConfirmPop = e.onConfirmPop || E, this.onCreateGroup = e.onCreateGroup || E, this.onUpdateMyGroupList = e.onUpdateMyGroupList || E, this.onUpdateMyRoster = e.onUpdateMyRoster || E, this.onBlacklistUpdate = e.onBlacklistUpdate || E, n._listenNetwork(this.onOnline, this.onOffline);
    }, O.prototype.getParams = function (e) {
      o = e.root, n = e.utils, O.prototype._utils = n, m.utils = n, m.statusCode = g, m.message = a.default, m.message.prototype._utils = n;
    }, O.prototype._msgHash = {}, O.prototype._queues = [], O.prototype._lastsession = function (e, t, r) {
      var i = [],
          n = o.lookup("easemob.pb.CommSyncUL"),
          s = n.decode(i);
      s.queue = t, s.key = new d.default(e.low, e.high, e.unsigned).toString(), r.isDebug && console.log("上行_lastsession: ", s), s = n.encode(s).finish();
      var a = o.lookup("easemob.pb.MSync"),
          u = a.decode(i);

      if (u.version = r.version, u.encryptType = r.encryptType, u.command = 0, u.payload = s, u = a.encode(u).finish(), r.sock.readyState !== _) {
        var p = {
          type: g.WEBIM_CONNCTION_DISCONNECTED
        };
        r.onError(p);
      } else r._base64transform(u, r);
    }, O.prototype._metapayload = function (e, t, r) {
      for (var i = 0; i < e.length; i++) {
        var o = new d.default(e[i].id.low, e[i].id.high, e[i].id.unsigned).toString();
        v.indexOf(o) < 0 && (r.isDebug && console.log("下行meta：", e[i]), 1 === e[i].ns ? (0, l.default)(e[i], t, r) : 2 === e[i].ns ? (0, c.default)(e[i], t, r) : 3 === e[i].ns ? h.default.handleMessage(e[i], t, r) : 0 === e[i].ns ? (0, f.default)(e[i], t, r) : 4 === e[i].ns && r.registerConfrIQHandler && r.registerConfrIQHandler(e[i], t, r), v.length <= 100 || v.shift(), v.push(o));
      }
    }, O.prototype._rebuild = function () {
      var e = [],
          t = o.lookup("easemob.pb.StatisticsBody"),
          r = t.decode(e);
      r.operation = 0, r = t.encode(r).finish();
      var i = o.lookup("easemob.pb.Meta").decode(e);
      i.id = new Date().valueOf(), i.ns = 0, i.payload = r;
      var n = o.lookup("easemob.pb.CommSyncUL"),
          s = n.decode(e);
      s.meta = i, this.isDebug && console.log("上行rebuild: ", i), s = n.encode(s).finish();
      var a = o.lookup("easemob.pb.MSync"),
          u = a.decode(e);
      u.version = "3.0.8", u.encryptType = [0], u.command = 0, u.payload = s, u = a.encode(u).finish(), this._base64transform(u, this);
    }, O.prototype._backqueue = function (e, t) {
      var r = [],
          i = o.lookup("easemob.pb.CommSyncUL"),
          n = i.decode(r);
      n.queue = e, t.isDebug && console.log("上行queue: ", n), n = i.encode(n).finish();
      var s = o.lookup("easemob.pb.MSync"),
          a = s.decode(r);
      a.version = t.version, a.encryptType = t.encryptType, a.command = 0, a.payload = n, a = s.encode(a).finish(), t._base64transform(a, t);
    };

    var N = function (e) {
      var t = o.lookup("easemob.pb.MSync"),
          r = t.decode([]);
      r.version = e.version, r.encryptType = e.encryptType, r.command = 1, e.isDebug && console.log("上行unreadDeal: ", r), r = t.encode(r).finish(), e._base64transform(r, e);
    };

    O.prototype._receiveProvision = function (e, t) {
      var r = o.lookup("easemob.pb.Provision").decode(e.payload);
      t.context.jid.clientResource = r.resource, 0 == r.status.errorCode && (N(t), t._rebuild(t));
    }, O.prototype.heartBeatID = 0, O.prototype.heartBeat = function (e) {
      this.stopHeartBeat(), this.heartBeatID = setInterval(function () {
        N(e);
      }, this.heartBeatWait);
    }, O.prototype.stopHeartBeat = function () {
      clearInterval(this.heartBeatID);
    }, O.prototype.getRestFromHttpDNS = function (e, t) {
      if (!(this.restIndex > this.restTotal)) {
        var r = "",
            i = this.restHosts[this.restIndex],
            o = i.domain,
            n = i.ip;

        if (n && "http:" == location.protocol) {
          var s = i.port;
          r = ("https:" === location.protocol ? "https:" : "http:") + "//" + n + ":" + s;
        } else r = ("https:" === location.protocol ? "https:" : "http:") + "//" + o;

        "" != r && (this.apiUrl = r, e.apiUrl = r), "login" == t ? this.login(e) : this.signup(e);
      }
    }, O.prototype.getHttpDNS = function (e, t) {
      var r = this,
          i = {
        url: this.dnsArr[this.dnsIndex] + "/easemob/server.json",
        dataType: "json",
        type: "GET",
        data: {
          app_key: encodeURIComponent(e.appKey || this.appKey)
        },
        success: function (i, o) {
          var n = i.rest.hosts;

          if (n) {
            for (var s = r.https ? "https" : "http", a = n.filter(function (e, t) {
              if (e.protocol == s) return e;
            }), u = 0; u < a.length; u++) if (a[u].protocol === s) {
              var p = a[u];
              a.splice(u, 1), a.unshift(p);
            }

            r.restHosts = a, r.restTotal = a.length;

            try {
              Array.prototype.slice.call(document.documentElement.childNodes, 0)[0].nodeType;
            } catch (e) {
              (function (e) {
                for (var t = [], r = 0, i = e.length; r < i; r++) t.push(e[r]);

                return t;
              });
            }

            var l = i["msync-ws"].hosts;

            if (l) {
              var c = l.filter(function (e, t) {
                if (e.protocol == s) return e;
              });

              for (u = 0; u < c.length; u++) if (c[u].protocol === s) {
                p = c[u];
                c.splice(u, 1), c.unshift(p);
              }

              r.xmppHosts = c, r.xmppTotal = c.length, r.getRestFromHttpDNS(e, t);
            }
          }
        } || E,
        error: function (i, o, n) {
          console.log("getHttpDNS error", i, n), r.dnsIndex++, r.dnsIndex < r.dnsTotal && r.getHttpDNS(e, t);
        } || E
      };
      n.ajax(i);
    }, O.prototype.signup = function (e) {
      var t = this,
          r = e.orgName || "",
          i = e.appName || "",
          o = e.appKey || this.appKey,
          s = e.success || E,
          a = e.error || E;

      if (!r && !i && o) {
        var u = o.split("#");
        2 === u.length && (r = u[0], i = u[1]);
      }

      if (r || i) {
        e.https || this.https;
        var p = (e.apiUrl || this.apiUrl) + "/" + r + "/" + i + "/users",
            l = {
          username: e.username,
          password: e.password,
          nickname: e.nickname || ""
        },
            c = {
          url: p,
          dataType: "json",
          data: n.stringify(l),
          success: s,
          error: function (r, i, o) {
            if (t.isHttpDNS && t.restIndex + 1 < t.restTotal) return t.restIndex++, void t.getRestFromHttpDNS(e, "signup");
            t.clear(), a(r);
          }
        };
        n.ajax(c);
      } else a({
        type: g.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR
      });
    }, O.prototype.open = function (e) {
      var t = e.appKey,
          r = t.split("#")[0],
          i = t.split("#")[1];
      this.orgName = r, this.appName = i, e.accessToken && (this.token = e.accessToken), this.isHttpDNS ? (this.dnsIndex = 0, this.getHttpDNS(e, "login")) : this.login(e);
    }, O.prototype.login = function (e) {
      if (this.user = e.user, function (e, t) {
        if ("" == (e = e || {}).user) return t.onError({
          type: g.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR
        }), !1;
        var r = e.user + "" || "",
            i = e.appKey || "",
            n = i.split("#");
        if (2 !== n.length) return t.onError({
          type: g.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR
        }), !1;
        var s = n[0],
            a = n[1];
        return s && a ? (t.context.jid = {
          appKey: i,
          name: r,
          domain: t.domain,
          clientResource: t.clientResource
        }, t.context.root = o, t.context.userId = r, t.context.appKey = i, t.context.appName = a, t.context.orgName = s, !0) : (t.onError({
          type: g.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR
        }), !1);
      }(e, this)) {
        var t = this;
        if (!t.isOpened()) if (e.accessToken) e.access_token = e.accessToken, this._login(e, t);else {
          var r = e.apiUrl,
              i = this.context.userId,
              s = e.pwd || "",
              a = this.context.appName,
              u = this.context.orgName,
              p = {
            grant_type: "password",
            username: i,
            password: s,
            timestamp: +new Date()
          },
              l = {
            headers: {
              "Content-type": "application/json"
            },
            url: r + "/" + u + "/" + a + "/token",
            dataType: "json",
            data: n.stringify(p),
            success: function (r, i) {
              e.success && e.success(r), t.token = r.access_token, t.context.restTokenData = r.access_token, t._login(r, t);
            } || E,
            error: function (r, i, o) {
              if (e.error && e.error(), t.isHttpDNS && t.restIndex + 1 < t.restTotal) return t.restIndex++, void t.getRestFromHttpDNS(e, "login");
              t.clear(), r.error && r.error_description ? t.onError({
                type: g.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,
                data: r,
                xhr: i
              }) : t.onError({
                type: g.WEBIM_CONNCTION_OPEN_ERROR,
                data: r,
                xhr: i
              });
            } || E
          };
          n.ajax(l);
        }
      }
    }, O.prototype.close = function (e) {
      this.logOut = !0, this.context.status = g.STATUS_CLOSING, this.sock.close(), this.stopHeartBeat(), this.context.status = g.STATUS_CLOSING;
    }, O.prototype.recallMessage = function (e) {
      var t = {
        id: this.getUniqueId(),
        type: "recall",
        group: e.type,
        ackId: e.mid,
        to: e.to,
        success: e.success,
        fail: e.fail
      };
      this.send(t, this);
    }, O.prototype.sendMSync = function (e) {
      if (this.sock.readyState === _) return this._base64transform(e, this);
      this.unSendMsgArr.push(this._base64transform(e, this, !0)), !this.logOut && this.autoReconnectNumTotal < this.autoReconnectNumMax && (this.autoReconnectNumTotal <= this.xmppHosts.length && this.isHttpDNS || !this.isHttpDNS) && (this.offLineSendConnecting = !0, this.reconnect()), this.onError({
        type: g.WEBIM_CONNCTION_DISCONNECTED,
        reconnect: !0
      });
    }, O.prototype.getUniqueId = function (e) {
      this.autoIncrement ? this.autoIncrement++ : this.autoIncrement = 1;
      var t = new Date(),
          r = new Date(2010, 1, 1);
      return t.getTime() - r.getTime() + this.autoIncrement;
    }, O.prototype.send = function (e) {
      (0, p.default)(e, this, n), this._msgHash[e.id] = e;
    }, O.prototype.removeRoster = function (e) {
      h.default.operatRoster(e, "remove", this);
    }, O.prototype.subscribe = function (e) {
      h.default.operatRoster(e, "add", this);
    }, O.prototype.subscribed = function (e) {
      h.default.operatRoster(e, "accept", this);
    }, O.prototype.unsubscribed = function (e) {
      h.default.operatRoster(e, "decline", this);
    }, O.prototype.isOpened = function () {
      return this.sock && this.sock.readyState === _;
    }, O.prototype.clear = function () {
      var e = this.context.appKey;

      if (this.errorType != g.WEBIM_CONNCTION_DISCONNECTED && this.logOut && (this.unSendMsgArr = [], this.offLineSendConnecting = !1, this.context = {
        status: g.STATUS_INIT,
        appKey: e
      }), this.intervalId && clearInterval(this.intervalId), this.restIndex = 0, this.xmppIndex = 0, this.errorType == g.WEBIM_CONNCTION_CLIENT_LOGOUT || -1 == this.errorType) {
        var t = {
          data: {
            data: "logout"
          },
          type: g.WEBIM_CONNCTION_CLIENT_LOGOUT
        };
        this.onError(t);
      }
    }, O.prototype.autoReconnectInterval = 0, O.prototype.times = 1, O.prototype.reconnect = function (e) {
      var t = this;
      t.xmppIndex < t.xmppHosts.length - 1 && t.xmppIndex++, setTimeout(function () {
        t._login({
          access_token: t.context.accessToken
        }, t), t.autoReconnectInterval += t.times * t.times, t.times++;
      }, 1e3 * (0 == this.autoReconnectNumTotal ? 0 : t.autoReconnectInterval)), this.autoReconnectNumTotal++;
    }, O.prototype.closed = function () {
      var e = {
        data: {
          data: "Closed error"
        },
        type: g.WEBIM_CONNECTION_CLOSED
      };
      this.onError(e), this.stopHeartBeat();
    }, O.prototype.addToBlackList = function (e) {
      h.default.operatRoster({
        to: e.name
      }, "ban", this);
    }, O.prototype.removeFromBlackList = function (e) {
      h.default.operatRoster({
        to: e.name
      }, "allow", this);
    }, Object.assign(O.prototype, y.default), m.connection = O, m.doQuery = function (e, t, r) {
      void 0 !== window.cefQuery && window.cefQuery({
        request: e,
        persistent: !1,
        onSuccess: t,
        onFailure: r
      });
    }, m.debug = function (e) {};
    var b = m;
    t.default = b;
  }, function (e, t, r) {
    "use strict";

    function i(e) {
      this.array = void 0 === e ? [] : new Array(e);
    }

    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.default = void 0, i.prototype = {
      length: function () {
        return this.array.length;
      },
      at: function (e) {
        return this.array[e];
      },
      set: function (e, t) {
        this.array[e] = t;
      },
      push: function (e) {
        return this.array.push(e);
      },
      slice: function (e, t) {
        return this.array = this.array.slice(e, t);
      },
      concat: function (e) {
        this.array = this.array.concat(e);
      },
      remove: function (e, t) {
        t = void 0 === t ? 1 : t, this.array.splice(e, t);
      },
      join: function (e) {
        return this.array.join(e);
      },
      clear: function () {
        this.array.length = 0;
      }
    };

    var o = function () {
      this._array_h = new i();
    };

    o.prototype = {
      _index: 0,
      push: function (e) {
        this._array_h.push(e);
      },
      pop: function () {
        var e = null;
        return this._array_h.length() && (e = this._array_h.at(this._index), 2 * ++this._index >= this._array_h.length() && (this._array_h.slice(this._index), this._index = 0)), e;
      },
      head: function () {
        var e = null,
            t = this._array_h.length();

        return t && (e = this._array_h.at(t - 1)), e;
      },
      tail: function () {
        var e = null;
        return this._array_h.length() && (e = this._array_h.at(this._index)), e;
      },
      length: function () {
        return this._array_h.length() - this._index;
      },
      empty: function () {
        return 0 === this._array_h.length();
      },
      clear: function () {
        this._array_h.clear();
      }
    };
    var n = o;
    t.default = n;
  }, function (e, t, r) {
    "use strict";

    var i = r(1);
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.default = void 0;
    var o,
        n,
        s,
        a,
        u = i(r(6));
    Object.keys || (Object.keys = (o = Object.prototype.hasOwnProperty, n = !{
      toString: null
    }.propertyIsEnumerable("toString"), a = (s = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"]).length, function (e) {
      if ("object" !== (0, u.default)(e) && ("function" != typeof e || null === e)) throw new TypeError("Object.keys called on non-object");
      var t,
          r,
          i = [];

      for (t in e) o.call(e, t) && i.push(t);

      if (n) for (r = 0; r < a; r++) o.call(e, s[r]) && i.push(s[r]);
      return i;
    }));
    var p = {
      emptyfn: function () {},
      stringify: function (e) {
        if ("undefined" != typeof JSON && JSON.stringify) return JSON.stringify(e);
        var t = "",
            r = [];
        return function e(i) {
          var o = !1;

          for (var n in "[object Array]" === Object.prototype.toString.call(i) ? (r.push("]", "["), o = !0) : "[object Object]" === Object.prototype.toString.call(i) && r.push("}", "{"), i) "[object Null]" === Object.prototype.toString.call(i[n]) ? i[n] = "null" : "[object Undefined]" === Object.prototype.toString.call(i[n]) && (i[n] = "undefined"), i[n] && "object" === (0, u.default)(i[n]) ? t += "," + (o ? "" : '"' + n + '":' + (o ? '"' : "")) + e(i[n]) : t += ',"' + (o ? "" : n + '":"') + i[n] + '"';

          return "" != t && (t = t.slice(1)), r.pop() + t + r.pop();
        }(e);
      },
      getFileSize: function (e) {
        var t = this.getFileLength(e);
        if (t > 1e7) return !1;
        var r = Math.round(t / 1e3);
        if (r < 1e3) t = r + " KB";else if (r >= 1e3) {
          var i = r / 1e3;
          if (i < 1e3) t = i.toFixed(1) + " MB";else t = (i / 1e3).toFixed(1) + " GB";
        }
        return t;
      },
      trim: function (e) {
        return (e = "string" == typeof e ? e : "").trim ? e.trim() : e.replace(/^\s|\s$/g, "");
      },
      parseTextMessage: function (e, t) {
        if ("string" == typeof e) {
          if ("[object Object]" !== Object.prototype.toString.call(t)) return {
            isemoji: !1,
            body: [{
              type: "txt",
              data: e
            }]
          };
          var r = e,
              i = [],
              o = r.match(/\[[^[\]]{2,3}\]/gm);
          if (!o || o.length < 1) return {
            isemoji: !1,
            body: [{
              type: "txt",
              data: e
            }]
          };

          for (var n = !1, s = 0; s < o.length; s++) {
            var a = r.substring(0, r.indexOf(o[s])),
                u = WebIM.Emoji.map[o[s]];

            if (a && i.push({
              type: "txt",
              data: a
            }), u) {
              var p = WebIM.Emoji.map ? WebIM.Emoji.path + u : null;
              p ? (n = !0, i.push({
                type: "emoji",
                data: p
              })) : i.push({
                type: "txt",
                data: o[s]
              });
              var l = r.indexOf(o[s]) + o[s].length;
              r = r.substring(l);
            } else i.push({
              type: "txt",
              data: o[s]
            });
          }

          return r && i.push({
            type: "txt",
            data: r
          }), n ? {
            isemoji: n,
            body: i
          } : {
            isemoji: !1,
            body: [{
              type: "txt",
              data: e
            }]
          };
        }
      },
      ts: function () {
        var e = new Date(),
            t = e.getHours(),
            r = e.getMinutes(),
            i = e.getSeconds();
        return (t < 10 ? "0" + t : t) + ":" + (r < 10 ? "0" + r : r) + ":" + (i < 10 ? "0" + i : i) + ":" + e.getMilliseconds() + " ";
      },
      getObjectKey: function (e, t) {
        for (var r in e) if (e[r] == t) return r;

        return "";
      },
      sprintf: function () {
        var e,
            t,
            r = arguments,
            i = r[0] || "";

        for (e = 1, t = r.length; e < t; e++) i = i.replace(/%s/, r[e]);

        return i;
      },
      reverse: function (e) {
        var t = [];
        if (Array.prototype.reverse) t = e.reverse();else for (var r = 0; r < e.length; r++) t.unshift(e[r]);
        return t;
      },
      checkArray: function (e, t) {
        var r = "off";
        if (e.forEach(function (e, i) {
          if (e.name === t.name) return r = "on", i;
        }), "off" == r) return !1;
      }
    },
        l = p;
    t.default = l;
  }, function (e, t, r) {
    "use strict";

    var i = r(1);
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.default = void 0;

    var o = i(r(8)),
        n = function (e, t, r) {
      var i = r.context.root.lookup("easemob.pb.MUCBody").decode(e.payload);
      new o.default(e.id.low, e.id.high, e.id.unsigned).toString();
      !function (e) {
        var t = {
          type: "",
          owner: i.from.name,
          gid: i.mucId.name,
          from: i.from.name,
          fromJid: i.from,
          to: i.to.length ? i.to[0].name : "",
          toJid: i.to,
          chatroom: i.isChatroom,
          status: i.status
        };
        (({
          32: function () {
            t.type = i.isChatroom ? "rmChatRoomMute" : "rmGroupMute", r.onPresence(t);
          },
          31: function () {
            t.type = i.isChatroom ? "muteChatRoom" : "muteGroup", r.onPresence(t);
          },
          30: function () {
            t.type = i.isChatroom ? "rmUserFromChatRoomWhiteList" : "rmUserFromGroupWhiteList", r.onPresence(t);
          },
          29: function () {
            t.type = i.isChatroom ? "addUserToChatRoomWhiteList" : "addUserToGroupWhiteList", r.onPresence(t);
          },
          28: function () {
            t.type = "deleteFile", r.onPresence(t);
          },
          27: function () {
            t.type = "uploadFile", r.onPresence(t);
          },
          26: function () {
            t.type = "deleteAnnouncement", r.onPresence(t);
          },
          25: function () {
            t.type = "updateAnnouncement", r.onPresence(t);
          },
          24: function () {
            t.type = "removeMute", r.onPresence(t);
          },
          23: function () {
            t.type = "addMute", r.onPresence(t);
          },
          22: function () {
            t.type = "removeAdmin", r.onPresence(t);
          },
          21: function () {
            t.type = "addAdmin", r.onPresence(t);
          },
          20: function () {
            t.type = "changeOwner", r.onPresence(t);
          },
          19: function () {
            t.type = "direct_joined", r.onPresence(t);
          },
          18: function () {
            t.type = i.isChatroom ? "leaveChatRoom" : "leaveGroup", r.onPresence(t);
          },
          17: function () {
            t.type = i.isChatroom ? "memberJoinChatRoomSuccess" : "memberJoinPublicGroupSuccess", r.onPresence(t);
          },
          16: function () {
            t.type = "unblock", r.onPresence(t);
          },
          15: function () {
            t.type = "block", r.onPresence(t);
          },
          14: function () {
            t.type = "update", r.onPresence(t);
          },
          13: function () {
            t.type = "allow", t.reason = i.reason, r.onPresence(t);
          },
          12: function () {
            t.type = "ban", r.onPresence(t);
          },
          11: function () {
            t.type = "getBlackList", r.onPresence(t);
          },
          10: function () {
            t.type = "removedFromGroup", t.kicked = t.to, r.onPresence(t);
          },
          9: function () {
            t.type = "invite_decline", t.kicked = t.to, r.onPresence(t);
          },
          8: function () {
            t.type = "invite_accept", t.kicked = t.to, r.onPresence(t);
          },
          7: function () {
            t.type = "invite", t.kicked = t.to, r.onPresence(t);
          },
          6: function () {
            t.type = "joinPublicGroupDeclined", r.onPresence(t);
          },
          5: function () {
            t.type = "joinPublicGroupSuccess", r.onPresence(t);
          },
          4: function () {
            t.type = "joinGroupNotifications", t.reason = i.reason, r.onPresence(t);
          },
          3: function () {
            t.type = "leave", r.onPresence(t);
          },
          2: function () {
            t.type = "join", r.onPresence(t);
          },
          1: function () {
            t.type = "deleteGroupChat", r.onPresence(t);
          }
        })[e] || function () {
          console.log("%c没有匹配".concat(e, "类型"), "background: green");
        })();
      }(i.operation);
    };

    t.default = n;
  }, function (e, t, r) {
    "use strict";

    var i = r(1);
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.default = void 0;
    var o = i(r(8)),
        n = {
      handleMessage: function (e, t, r) {
        var i = r.context.root.lookup("easemob.pb.RosterBody").decode(e.payload),
            n = (new o.default(e.id.low, e.id.high, e.id.unsigned).toString(), {
          to: i.to[0].name,
          from: i.from.name,
          status: i.reason
        });

        switch (i.operation) {
          case 0:
            break;

          case 2:
            n.type = "subscribe";
            break;

          case 3:
            n.type = "unsubscribed";
            break;

          case 4:
            n.type = "subscribed";
            break;

          case 5:
            n.type = "unsubscribed";
            break;

          case 6:
          case 7:
            r.getBlacklist();
            break;

          case 8:
            n.type = "subscribed";
            break;

          case 9:
            n.type = "unsubscribed";
        }

        r.onPresence(n);
      },
      operatRoster: function (e, t, r) {
        var i = [],
            o = r.context.root.lookup("easemob.pb.RosterBody"),
            n = o.decode(i);
        "add" === t ? n.operation = 2 : "remove" === t ? n.operation = 3 : "accept" === t ? n.operation = 4 : "decline" === t ? n.operation = 5 : "ban" === t ? n.operation = 6 : "allow" === t && (n.operation = 7), n.from = r.context.jid;
        var s = [];
        if ("string" == typeof e.to) s.push({
          appKey: r.appKey || r.context.appKey,
          name: e.to,
          domain: "easemob.com"
        });else if (e.to instanceof Array) for (var a = 0; a < e.to.length; a++) s.push({
          appKey: r.appKey,
          name: e.to[a],
          domain: "easemob.com"
        });
        n.to = s, n.reason = e.message, n = o.encode(n).finish();
        var u = r.context.root.lookup("easemob.pb.Meta").decode(i);
        u.id = e.id || r.getUniqueId(), u.from = r.context.jid, u.to = {
          domain: "@easemob.com"
        }, u.ns = 3, u.payload = n;
        var p = r.context.root.lookup("easemob.pb.CommSyncUL"),
            l = p.decode(i);
        l.meta = u, l = p.encode(l).finish();
        var c = r.context.root.lookup("easemob.pb.MSync"),
            h = c.decode(i);
        h.version = r.version, h.encryptType = [0], h.command = 0, h.guid = r.jid, h.payload = l, h = c.encode(h).finish(), r.sendMSync(h);
      }
    };
    t.default = n;
  }, function (e, t, r) {
    "use strict";

    var i = r(1);
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.default = void 0;

    var o = i(r(8)),
        n = (0, i(r(7)).default)(),
        s = function (e, t, r) {
      var i = r.context.root.lookup("easemob.pb.StatisticsBody").decode(e.payload);
      new o.default(e.id.low, e.id.high, e.id.unsigned).toString();

      switch (i.operation) {
        case 0:
          r.onStatisticMessage(i);
          break;

        case 1:
          var s = {
            type: n.WEBIM_CONNCTION_USER_REMOVED
          };
          r.logOut = !0, r.onError(s);
          break;

        case 2:
          s = {
            type: n.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE
          };
          r.logOut = !0, r.onError(s);
          break;

        case 3:
          s = {
            type: n.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD
          };
          r.logOut = !0, r.onError(s);
          break;

        case 4:
          s = {
            type: n.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE
          };
          r.logOut = !0, r.onError(s);
      }
    };

    t.default = s;
  }, function (e, t, r) {
    "use strict";

    var i = r(1);
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.default = void 0;
    var o,
        n = i(r(59)),
        s = i(r(30)),
        a = i(r(7)),
        u = i(r(35)),
        p = (0, a.default)(),
        l = (o = {
      mr_cache: [],
      _fetchMessages: function (e, t) {
        var r = e.accessToken || t.context.accessToken;
        if (t._utils.isCanSetRequestHeader) {
          if (r) {
            var i = t.apiUrl,
                o = t.context.appName,
                n = t.context.orgName;
            if (!o || !n) return void t.onError({
              type: p.WEBIM_CONNCTION_AUTH_ERROR
            });
            if (!e.queue) return void t.onError({
              type: "",
              msg: "queue is not specified"
            });
            var a = e.queue,
                l = this.mr_cache[a] || (this.mr_cache[a] = {
              msgs: []
            }),
                c = t.context.userId,
                h = -1;
            if (l.msgs.length >= e.count || l.is_last) return void ("function" == typeof e.success && e.success(l));
            l && l.next_key && (h = l.next_key);
            var f = {
              queue: a + (e.isGroup ? "@conference.easemob.com" : "@easemob.com"),
              start: h,
              end: -1
            },
                d = {
              url: i + "/" + n + "/" + o + "/users/" + c + "/messageroaming",
              dataType: "json",
              type: "POST",
              headers: {
                Authorization: "Bearer " + r
              },
              data: JSON.stringify(f),
              success: function (r, i) {
                if (r && r.data) {
                  var o = r.data;
                  if (!r.data.msgs) return "function" == typeof e.success && e.success(l), l.is_last = !0, void (l.next_key = "");
                  var n = o.msgs,
                      a = n.length;
                  l.is_last = o.is_last, l.next_key = o.next_key;

                  var p = function (e) {
                    for (var r = [], i = 0, o = (e = u.default.atob(e)).length; i < o; ++i) r.push(e.charCodeAt(i));

                    var n = t.context.root.lookup("easemob.pb.Meta");
                    if (1 == (n = n.decode(r)).ns) return (0, s.default)(n, {
                      errorCode: 0,
                      reason: ""
                    }, t, !0);
                  };

                  try {
                    for (var c = 0; c < a; c++) {
                      var h = p(n[c].msg);
                      h && l.msgs.push(h);
                    }
                  } catch (e) {
                    console.log(e);
                  } finally {
                    "function" == typeof e.success && e.success(l);
                  }
                }
              } || t._utils.emptyfn,
              error: function (e, r) {
                e.error && e.error_description && t.onError({
                  type: p.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,
                  msg: e.error_description,
                  data: e
                });
              } || t._utils.emptyfn
            };

            t._utils.ajax(d);
          } else t.onError({
            type: p.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR
          });
        } else t.onError({
          type: p.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR
        });
      },
      fetchHistoryMessages: function (e) {
        var t = this;

        if (e.queue) {
          var r = e.count || 20;
          !function i() {
            t._fetchMessages({
              count: r,
              isGroup: !!e.isGroup,
              queue: e.queue,
              success: function (o) {
                o.msgs.length >= r || o.is_last ? e.success && e.success(t._utils.reverse(o.msgs.splice(0, r))) : i();
              },
              fail: function () {}
            }, t);
          }();
        } else t.onError({
          type: "",
          msg: "queue is not specified"
        });
      },
      getChatRooms: function (e) {
        var t = this,
            r = e.accessToken || this.context.accessToken;
        if (t._utils.isCanSetRequestHeader) {
          if (r) {
            var i = e.apiUrl,
                o = this.context.appName,
                n = this.context.orgName;
            if (!o || !n) return void t.onError({
              type: p.WEBIM_CONNCTION_AUTH_ERROR
            });
            var s = {
              url: i + "/" + n + "/" + o + "/chatrooms",
              dataType: "json",
              type: "GET",
              headers: {
                Authorization: "Bearer " + r
              },
              data: {
                pagenum: parseInt(e.pagenum) || 1,
                pagesize: parseInt(e.pagesize) || 20
              },
              success: function (t, r) {
                "function" == typeof e.success && e.success(t);
              } || t._utils.emptyfn,
              error: function (e, r, i) {
                e.error && e.error_description && t.onError({
                  type: p.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,
                  msg: e.error_description,
                  data: e,
                  xhr: r
                });
              } || t._utils.emptyfn
            };

            t._utils.ajax(s);
          } else t.onError({
            type: p.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR
          });
        } else t.onError({
          type: p.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR
        });
      },
      joinChatRoom: function (e) {
        e = e || {};

        if (this._utils.isCanSetRequestHeader) {
          var t = this,
              r = e.accessToken || this.token;

          if (r) {
            var i = e.apiUrl || this.apiUrl,
                o = this.context.appName,
                n = this.context.orgName,
                s = e.roomId,
                a = e.message || "";
            if (!o || !n) return void t.onError({
              type: p.WEBIM_CONNCTION_AUTH_ERROR
            });
            var u = {
              url: i + "/" + n + "/" + o + "/chatrooms/" + s + "/apply",
              dataType: "json",
              type: "POST",
              data: JSON.stringify({
                message: a
              }),
              headers: {
                Authorization: "Bearer " + r,
                "Content-Type": "application/json"
              },
              success: function (t, r) {
                "function" == typeof e.success && e.success(t);
              } || t._utils.emptyfn,
              error: function (t, r, i) {
                "function" == typeof e.error && e.error(t);
              } || t._utils.emptyfn
            };

            t._utils.ajax(u);
          } else t.onError({
            type: p.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR
          });
        } else t.onError({
          type: p.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR
        });
      },
      quitChatRoom: function (e) {
        e = e || {};

        if (this._utils.isCanSetRequestHeader) {
          var t = this,
              r = e.accessToken || this.token;

          if (r) {
            var i = e.apiUrl || this.apiUrl,
                o = this.context.appName,
                n = this.context.orgName,
                s = e.roomId;
            if (!o || !n) return void t.onError({
              type: p.WEBIM_CONNCTION_AUTH_ERROR
            });
            var a = {
              url: i + "/" + n + "/" + o + "/chatrooms/" + s + "/quit",
              dataType: "json",
              type: "DELETE",
              headers: {
                Authorization: "Bearer " + r
              },
              success: function (t, r) {
                "function" == typeof e.success && e.success(t);
              } || t._utils.emptyfn,
              error: function (t, r, i) {
                "function" == typeof e.error && e.error(t);
              } || t._utils.emptyfn
            };

            t._utils.ajax(a);
          } else t.onError({
            type: p.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR
          });
        } else t.onError({
          type: p.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR
        });
      },
      createGroupNew: function (e) {
        e.data.owner = this.user, e.data.invite_need_confirm = !1;
        var t = {
          url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups",
          dataType: "json",
          type: "POST",
          data: JSON.stringify(e.data),
          headers: {
            Authorization: "Bearer " + this.token,
            "Content-Type": "application/json"
          }
        };
        t.success = function (t) {
          e.success(t), this.onCreateGroup(t);
        }.bind(this), t.error = e.error || this._utils.emptyfn, this._utils.ajax(t);
      },
      blockGroup: function (e) {
        var t = e.groupId;
        t = "notification_ignore_" + t;
        var r = {
          entities: []
        };
        r.entities[0] = {}, r.entities[0][t] = !0;
        var i = {
          type: "PUT",
          url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/users/" + this.user,
          data: JSON.stringify(r),
          headers: {
            Authorization: "Bearer " + this.token,
            "Content-Type": "application/json"
          }
        };
        i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
      },
      listGroups: function (e) {
        var t = [];
        if (t.limit = e.limit, t.cursor = e.cursor, t.cursor || delete t.cursor, isNaN(e.limit)) throw 'The parameter "limit" should be a number';
        var r = {
          url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/publicchatgroups",
          type: "GET",
          dataType: "json",
          data: t,
          headers: {
            Authorization: "Bearer " + this.token,
            "Content-Type": "application/json"
          }
        };
        r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
      },
      getGroup: function (e) {
        var t = {
          url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/users/" + this.user + "/joined_chatgroups",
          dataType: "json",
          type: "GET",
          headers: {
            Authorization: "Bearer " + this.token,
            "Content-Type": "application/json"
          }
        };
        t.success = e.success || this._utils.emptyfn, t.error = e.error || this._utils.emptyfn, this._utils.ajax(t);
      },
      changeOwner: function (e) {
        var t = {
          newowner: e.newOwner
        },
            r = {
          url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + e.groupId,
          type: "PUT",
          dataType: "json",
          headers: {
            Authorization: "Bearer " + this.token,
            "Content-Type": "application/json"
          },
          data: JSON.stringify(t)
        };
        r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
      },
      getGroupInfo: function (e) {
        var t = {
          url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + e.groupId + "?joined_time=true",
          type: "GET",
          dataType: "json",
          headers: {
            Authorization: "Bearer " + this.token,
            "Content-Type": "application/json"
          }
        };
        t.success = e.success || this._utils.emptyfn, t.error = e.error || this._utils.emptyfn, this._utils.ajax(t);
      },
      modifyGroup: function (e) {
        var t = e.groupId,
            r = {
          groupname: e.groupName,
          description: e.description
        },
            i = {
          url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t,
          type: "PUT",
          data: JSON.stringify(r),
          dataType: "json",
          headers: {
            Authorization: "Bearer " + this.token,
            "Content-Type": "application/json"
          }
        };
        i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
      },
      listGroupMember: function (e) {
        if (isNaN(e.pageNum) || e.pageNum <= 0) throw 'The parameter "pageNum" should be a positive number';
        if (isNaN(e.pageSize) || e.pageSize <= 0) throw 'The parameter "pageSize" should be a positive number';
        if (null === e.groupId && void 0 === e.groupId) throw 'The parameter "groupId" should be added';
        var t = [],
            r = e.groupId;
        t.pagenum = e.pageNum, t.pagesize = e.pageSize;
        var i = {
          url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + r + "/users",
          dataType: "json",
          type: "GET",
          data: t,
          headers: {
            Authorization: "Bearer " + this.token,
            "Content-Type": "application/json"
          }
        };
        i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
      }
    }, (0, n.default)(o, "listGroupMember", function (e) {
      if (isNaN(e.pageNum) || e.pageNum <= 0) throw 'The parameter "pageNum" should be a positive number';
      if (isNaN(e.pageSize) || e.pageSize <= 0) throw 'The parameter "pageSize" should be a positive number';
      if (null === e.groupId && void 0 === e.groupId) throw 'The parameter "groupId" should be added';
      var t = [],
          r = e.groupId;
      t.pagenum = e.pageNum, t.pagesize = e.pageSize;
      var i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + r + "/users",
        dataType: "json",
        type: "GET",
        data: t,
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "listChatRoomMember", function (e) {
      if (isNaN(e.pageNum) || e.pageNum <= 0) throw 'The parameter "pageNum" should be a positive number';
      if (isNaN(e.pageSize) || e.pageSize <= 0) throw 'The parameter "pageSize" should be a positive number';
      if (null === e.chatRoomId && void 0 === e.chatRoomId) throw 'The parameter "chatRoomId" should be added';
      var t = [],
          r = e.chatRoomId;
      t.pagenum = e.pageNum, t.pagesize = e.pageSize;
      var i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatrooms/" + r + "/users",
        dataType: "json",
        type: "GET",
        data: t,
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "getGroupAdmin", function (e) {
      var t = e.groupId,
          r = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/admin",
        dataType: "json",
        type: "GET",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
    }), (0, n.default)(o, "setAdmin", function (e) {
      var t = e.groupId,
          r = {
        newadmin: e.username
      },
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/admin",
        type: "POST",
        dataType: "json",
        data: JSON.stringify(r),
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "removeAdmin", function (e) {
      var t = e.groupId,
          r = e.username,
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/admin/" + r,
        type: "DELETE",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "dissolveGroup", function (e) {
      var t = e.groupId,
          r = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "?version=v3",
        type: "DELETE",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
    }), (0, n.default)(o, "quitGroup", function (e) {
      var t = e.groupId,
          r = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/quit",
        type: "DELETE",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
    }), (0, n.default)(o, "inviteToGroup", function (e) {
      var t = e.groupId,
          r = {
        usernames: e.users
      },
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/invite",
        type: "POST",
        data: JSON.stringify(r),
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "joinGroup", function (e) {
      var t = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + e.groupId + "/apply",
        type: "POST",
        dataType: "json",
        data: JSON.stringify({
          message: "join group"
        }),
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      t.success = e.success || this._utils.emptyfn, t.error = e.error || this._utils.emptyfn, this._utils.ajax(t);
    }), (0, n.default)(o, "agreeJoinGroup", function (e) {
      var t = e.groupId,
          r = {
        applicant: e.applicant,
        verifyResult: !0,
        reason: "no clue"
      },
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/apply_verify",
        type: "POST",
        dataType: "json",
        data: JSON.stringify(r),
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "rejectJoinGroup", function (e) {
      var t = e.groupId,
          r = {
        applicant: e.applicant,
        verifyResult: !1,
        reason: "no clue"
      },
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/apply_verify",
        type: "POST",
        dataType: "json",
        data: JSON.stringify(r),
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "agreeInviteIntoGroup", function (e) {
      var t = e.groupId,
          r = {
        invitee: e.invitee,
        verifyResult: !0
      },
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/invite_verify",
        type: "POST",
        dataType: "json",
        data: JSON.stringify(r),
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "rejectInviteIntoGroup", function (e) {
      var t = e.groupId,
          r = {
        invitee: e.invitee,
        verifyResult: !1
      },
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/invite_verify",
        type: "POST",
        dataType: "json",
        data: JSON.stringify(r),
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "removeSingleGroupMember", function (e) {
      var t = e.groupId,
          r = e.username,
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/users/" + r,
        type: "DELETE",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "removeMultiGroupMember", function (e) {
      var t = e.groupId,
          r = e.users.join(","),
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/users/" + r,
        type: "DELETE",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "mute", function (e) {
      var t = e.groupId,
          r = {
        usernames: [e.username],
        mute_duration: e.muteDuration
      },
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/mute",
        dataType: "json",
        type: "POST",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        },
        data: JSON.stringify(r)
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "muteChatRoomMember", function (e) {
      var t = e.chatRoomId,
          r = {
        usernames: [e.username],
        mute_duration: e.muteDuration
      },
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatrooms/" + t + "/mute",
        dataType: "json",
        type: "POST",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        },
        data: JSON.stringify(r)
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "removeMute", function (e) {
      var t = e.groupId,
          r = e.username,
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/mute/" + r,
        dataType: "json",
        type: "DELETE",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "removeMuteChatRoomMember", function (e) {
      var t = e.chatRoomId,
          r = e.username,
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatrooms/" + t + "/mute/" + r,
        dataType: "json",
        type: "DELETE",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "getMuted", function (e) {
      var t = e.groupId,
          r = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/mute",
        dataType: "json",
        type: "GET",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
    }), (0, n.default)(o, "getChatRoomMuted", function (e) {
      var t = e.chatRoomId,
          r = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatrooms/" + t + "/mute",
        dataType: "json",
        type: "GET",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
    }), (0, n.default)(o, "groupBlockSingle", function (e) {
      var t = e.groupId,
          r = e.username,
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/blocks/users/" + r,
        type: "POST",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "chatRoomBlockSingle", function (e) {
      var t = e.chatRoomId,
          r = e.username,
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatrooms/" + t + "/blocks/users/" + r,
        type: "POST",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "groupBlockMulti", function (e) {
      var t = e.groupId,
          r = {
        usernames: e.usernames
      },
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/blocks/users",
        data: JSON.stringify(r),
        type: "POST",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "chatRoomBlockMulti", function (e) {
      var t = e.chatRoomId,
          r = {
        usernames: e.usernames
      },
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatrooms/" + t + "/blocks/users",
        data: JSON.stringify(r),
        type: "POST",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "removeGroupBlockSingle", function (e) {
      var t = e.groupId,
          r = e.username,
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/blocks/users/" + r,
        type: "DELETE",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "removeChatRoomBlockSingle", function (e) {
      var t = e.chatRoomId,
          r = e.username,
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatrooms/" + t + "/blocks/users/" + r,
        type: "DELETE",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "removeGroupBlockMulti", function (e) {
      var t = e.groupId,
          r = e.usernames.join(","),
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/blocks/users/" + r,
        type: "DELETE",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "removeChatRoomBlockMulti", function (e) {
      var t = e.chatRoomId,
          r = e.usernames.join(","),
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatrooms/" + t + "/blocks/users/" + r,
        type: "DELETE",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "getGroupBlacklistNew", function (e) {
      var t = e.groupId,
          r = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/blocks/users",
        type: "GET",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
    }), (0, n.default)(o, "getChatRoomBlacklistNew", function (e) {
      var t = e.chatRoomId,
          r = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatrooms/" + t + "/blocks/users",
        type: "GET",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
    }), (0, n.default)(o, "disableSendGroupMsg", function (e) {
      var t = e.groupId,
          r = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/ban",
        type: "POST",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
    }), (0, n.default)(o, "disableSendChatRoomMsg", function (e) {
      var t = e.chatRoomId,
          r = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatrooms/" + t + "/ban",
        type: "POST",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
    }), (0, n.default)(o, "enableSendGroupMsg", function (e) {
      var t = e.groupId,
          r = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/ban",
        type: "DELETE",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
    }), (0, n.default)(o, "enableSendChatRoomMsg", function (e) {
      var t = e.chatRoomId,
          r = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatrooms/" + t + "/ban",
        type: "DELETE",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
    }), (0, n.default)(o, "addUsersToGroupWhitelist", function (e) {
      var t = e.groupId,
          r = {
        usernames: e.users
      },
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/white/users",
        type: "POST",
        data: JSON.stringify(r),
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "addUsersToChatRoomWhitelist", function (e) {
      var t = e.chatRoomId,
          r = {
        usernames: e.users
      },
          i = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatrooms/" + t + "/white/users",
        type: "POST",
        data: JSON.stringify(r),
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      i.success = e.success || this._utils.emptyfn, i.error = e.error || this._utils.emptyfn, this._utils.ajax(i);
    }), (0, n.default)(o, "rmUsersFromGroupWhitelist", function (e) {
      var t = e.groupId,
          r = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/white/users/" + e.userName,
        type: "DELETE",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
    }), (0, n.default)(o, "rmUsersFromChatRoomWhitelist", function (e) {
      var t = e.chatRoomId,
          r = {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatrooms/" + t + "/white/users/" + e.userName,
        type: "DELETE",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
    }), (0, n.default)(o, "getGroupWhitelist", function (e) {
      var t = e.groupId,
          r = (e.users, {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/white/users",
        type: "GET",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      });
      r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
    }), (0, n.default)(o, "getChatRoomWhitelist", function (e) {
      var t = e.chatRoomId,
          r = (e.users, {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatrooms/" + t + "/white/users",
        type: "GET",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      });
      r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
    }), (0, n.default)(o, "isGroupWhiteUser", function (e) {
      var t = e.groupId,
          r = (e.users, {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatgroups/" + t + "/white/users/" + e.userName,
        type: "GET",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      });
      r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
    }), (0, n.default)(o, "isChatRoomWhiteUser", function (e) {
      var t = e.chatRoomId,
          r = (e.users, {
        url: this.apiUrl + "/" + this.orgName + "/" + this.appName + "/chatrooms/" + t + "/white/users/" + e.userName,
        type: "GET",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      });
      r.success = e.success || this._utils.emptyfn, r.error = e.error || this._utils.emptyfn, this._utils.ajax(r);
    }), (0, n.default)(o, "getGroupMsgReadUser", function (e) {
      var t = this;
      e = e || {};

      if (this._utils.isCanSetRequestHeader) {
        var r = e.accessToken || this.token;

        if (r) {
          var i = t.apiUrl,
              o = t.context.appName,
              n = t.context.orgName;
          if (!o || !n) return void t.onError({
            type: p.WEBIM_CONNCTION_AUTH_ERROR
          });
          var s = {
            url: i + "/" + n + "/" + o + "/chatgroups/" + e.groupId + "/acks/" + e.msgId,
            dataType: "json",
            type: "GET",
            data: {
              limit: 500,
              key: void 0
            },
            headers: {
              Authorization: "Bearer " + r
            },
            success: function (t) {
              "function" == typeof e.success && e.success(t);
            } || this._utils.emptyfn,
            error: function (t) {
              "function" == typeof e.error && e.error(t);
            } || this._utils.emptyfn
          };

          this._utils.ajax(s);
        } else t.onError({
          type: p.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR
        });
      } else conn.onError({
        type: p.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR
      });
    }), (0, n.default)(o, "getBlacklist", function (e) {
      var t = this;
      e = e || {};

      if (this._utils.isCanSetRequestHeader) {
        var r = this,
            i = e.accessToken || this.token;

        if (i) {
          var o = e.apiUrl || this.apiUrl,
              n = this.context.appName,
              s = this.context.orgName;
          if (!n || !s) return void r.onError({
            type: p.WEBIM_CONNCTION_AUTH_ERROR
          });
          var a = {
            url: o + "/" + s + "/" + n + "/users/" + this.user + "/blocks/users",
            dataType: "json",
            type: "GET",
            headers: {
              Authorization: "Bearer " + i
            },
            success: function (r, i) {
              var o = {};
              r.data.forEach(function (e, t) {
                o[e] = {
                  name: e
                };
              }), t.onBlacklistUpdate(o), "function" == typeof e.success && e.success(r);
            } || this._utils.emptyfn,
            error: function (r, i, o) {
              t.onBlacklistUpdate([]), "function" == typeof e.error && e.error(r);
            } || this._utils.emptyfn
          };

          this._utils.ajax(a);
        } else r.onError({
          type: p.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR
        });
      } else r.onError({
        type: p.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR
      });
    }), (0, n.default)(o, "getRoster", function (e) {
      e = e || {};
      var t = this;

      if (this._utils.isCanSetRequestHeader) {
        var r = this,
            i = e.accessToken || this.token;

        if (i) {
          var o = e.apiUrl || this.apiUrl,
              n = this.context.appName,
              s = this.context.orgName;
          if (!n || !s) return void r.onError({
            type: p.WEBIM_CONNCTION_AUTH_ERROR
          });
          var a = {
            url: o + "/" + s + "/" + n + "/users/" + this.user + "/contacts/users",
            dataType: "json",
            type: "GET",
            headers: {
              Authorization: "Bearer " + i
            },
            success: function (r, i) {
              var o = [];
              r.data.forEach(function (e, r) {
                o.push({
                  name: e,
                  subscription: "both",
                  jid: t.context.jid
                });
              }), "function" == typeof e.success && e.success(o), t.onRoster && t.onRoster(o);
            } || this._utils.emptyfn,
            error: function (t, r, i) {
              "function" == typeof e.error && e.error(t);
            } || this._utils.emptyfn
          };

          this._utils.ajax(a);
        } else r.onError({
          type: p.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR
        });
      } else r.onError({
        type: p.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR
      });
    }), (0, n.default)(o, "fetchGroupAnnouncement", function (e) {
      var t = e.apiUrl || this.apiUrl,
          r = this.context.appName,
          i = this.context.orgName,
          o = e.groupId,
          n = {
        url: "".concat(t, "/").concat(i, "/").concat(r, "/chatgroups/").concat(o, "/announcement"),
        type: "GET",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      n.success = e.success || this._utils.emptyfn, n.error = e.error || this._utils.emptyfn, this._utils.ajax(n);
    }), (0, n.default)(o, "fetchChatRoomAnnouncement", function (e) {
      var t = e.apiUrl || this.apiUrl,
          r = this.context.appName,
          i = this.context.orgName,
          o = e.roomId,
          n = {
        url: "".concat(t, "/").concat(i, "/").concat(r, "/chatrooms/").concat(o, "/announcement"),
        type: "GET",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      n.success = e.success || this._utils.emptyfn, n.error = e.error || this._utils.emptyfn, this._utils.ajax(n);
    }), (0, n.default)(o, "updateGroupAnnouncement", function (e) {
      var t = e.apiUrl || this.apiUrl,
          r = this.context.appName,
          i = this.context.orgName,
          o = e.groupId,
          n = {
        announcement: e.announcement
      },
          s = {
        url: "".concat(t, "/").concat(i, "/").concat(r, "/chatgroups/").concat(o, "/announcement"),
        type: "POST",
        dataType: "json",
        data: JSON.stringify(n),
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      s.success = e.success || this._utils.emptyfn, s.error = e.error || this._utils.emptyfn, this._utils.ajax(s);
    }), (0, n.default)(o, "updateChatRoomAnnouncement", function (e) {
      var t = e.apiUrl || this.apiUrl,
          r = this.context.appName,
          i = this.context.orgName,
          o = e.roomId,
          n = {
        announcement: e.announcement
      },
          s = {
        url: "".concat(t, "/").concat(i, "/").concat(r, "/chatrooms/").concat(o, "/announcement"),
        type: "POST",
        dataType: "json",
        data: JSON.stringify(n),
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      s.success = e.success || this._utils.emptyfn, s.error = e.error || this._utils.emptyfn, this._utils.ajax(s);
    }), (0, n.default)(o, "uploadGroupSharedFile", function (e) {
      var t = e.apiUrl || this.apiUrl,
          r = this.context.appName,
          i = this.context.orgName,
          o = e.groupId;

      this._utils.uploadFile({
        uploadUrl: "".concat(t, "/").concat(i, "/").concat(r, "/chatgroups/").concat(o, "/share_files"),
        onFileUploadProgress: e.onFileUploadProgress,
        onFileUploadComplete: e.onFileUploadComplete,
        onFileUploadError: e.onFileUploadError,
        onFileUploadCanceled: e.onFileUploadCanceled,
        accessToken: this.token,
        apiUrl: t,
        file: e.file,
        appKey: this.context.appKey
      });
    }), (0, n.default)(o, "uploadChatRoomSharedFile", function (e) {
      var t = e.apiUrl || this.apiUrl,
          r = this.context.appName,
          i = this.context.orgName,
          o = e.roomId;

      this._utils.uploadFile({
        uploadUrl: "".concat(t, "/").concat(i, "/").concat(r, "/chatrooms/").concat(o, "/share_files"),
        onFileUploadProgress: e.onFileUploadProgress,
        onFileUploadComplete: e.onFileUploadComplete,
        onFileUploadError: e.onFileUploadError,
        onFileUploadCanceled: e.onFileUploadCanceled,
        accessToken: this.token,
        apiUrl: t,
        file: e.file,
        appKey: this.context.appKey
      });
    }), (0, n.default)(o, "deleteGroupSharedFile", function (e) {
      var t = e.apiUrl || this.apiUrl,
          r = this.context.appName,
          i = this.context.orgName,
          o = e.groupId,
          n = e.fileId,
          s = {
        url: "".concat(t, "/").concat(i, "/").concat(r, "/chatgroups/").concat(o, "/share_files/").concat(n),
        type: "DELETE",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      s.success = e.success || this._utils.emptyfn, s.error = e.error || this._utils.emptyfn, this._utils.ajax(s);
    }), (0, n.default)(o, "deleteChatRoomSharedFile", function (e) {
      var t = e.apiUrl || this.apiUrl,
          r = this.context.appName,
          i = this.context.orgName,
          o = e.roomId,
          n = e.fileId,
          s = {
        url: "".concat(t, "/").concat(i, "/").concat(r, "/chatrooms/").concat(o, "/share_files/").concat(n),
        type: "DELETE",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      s.success = e.success || this._utils.emptyfn, s.error = e.error || this._utils.emptyfn, this._utils.ajax(s);
    }), (0, n.default)(o, "downloadGroupSharedFile", function (e) {
      var t = e.apiUrl || this.apiUrl,
          r = this.context.appName,
          i = this.context.orgName,
          o = e.groupId,
          n = e.fileId;

      this._utils.download.call(this, {
        url: "".concat(t, "/").concat(i, "/").concat(r, "/chatgroups/").concat(o, "/share_files/").concat(n),
        onFileDownloadComplete: e.onFileDownloadComplete,
        onFileDownloadError: e.onFileDownloadError,
        accessToken: this.token,
        id: n,
        secret: ""
      });
    }), (0, n.default)(o, "downloadChatRoomSharedFile", function (e) {
      var t = e.apiUrl || this.apiUrl,
          r = this.context.appName,
          i = this.context.orgName,
          o = e.roomId,
          n = e.fileId;

      this._utils.download.call(this, {
        url: "".concat(t, "/").concat(i, "/").concat(r, "/chatrooms/").concat(o, "/share_files/").concat(n),
        onFileDownloadComplete: e.onFileDownloadComplete,
        onFileDownloadError: e.onFileDownloadError,
        accessToken: this.token,
        id: n,
        secret: ""
      });
    }), (0, n.default)(o, "fetchGroupSharedFileList", function (e) {
      var t = e.apiUrl || this.apiUrl,
          r = this.context.appName,
          i = this.context.orgName,
          o = e.groupId,
          n = {
        url: "".concat(t, "/").concat(i, "/").concat(r, "/chatgroups/").concat(o, "/share_files"),
        type: "GET",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      n.success = e.success || this._utils.emptyfn, n.error = e.error || this._utils.emptyfn, this._utils.ajax(n);
    }), (0, n.default)(o, "fetchChatRoomSharedFileList", function (e) {
      var t = e.apiUrl || this.apiUrl,
          r = this.context.appName,
          i = this.context.orgName,
          o = e.roomId,
          n = {
        url: "".concat(t, "/").concat(i, "/").concat(r, "/chatrooms/").concat(o, "/share_files"),
        type: "GET",
        dataType: "json",
        headers: {
          Authorization: "Bearer " + this.token,
          "Content-Type": "application/json"
        }
      };
      n.success = e.success || this._utils.emptyfn, n.error = e.error || this._utils.emptyfn, this._utils.ajax(n);
    }), o);
    t.default = l;
  }, function (e, t, r) {
    "use strict";

    e.exports = function (e, t, r) {
      return t in e ? Object.defineProperty(e, t, {
        value: r,
        enumerable: !0,
        configurable: !0,
        writable: !0
      }) : e[t] = r, e;
    };
  }, function (e, t, r) {
    "use strict";

    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.default = void 0;

    var i = function () {
      return {
        nested: {
          easemob: {
            nested: {
              pb: {
                nested: {
                  MessageBody: {
                    fields: {
                      type: {
                        type: "Type",
                        id: 1
                      },
                      from: {
                        type: "JID",
                        id: 2
                      },
                      to: {
                        type: "JID",
                        id: 3
                      },
                      contents: {
                        rule: "repeated",
                        type: "Content",
                        id: 4
                      },
                      ext: {
                        rule: "repeated",
                        type: "KeyValue",
                        id: 5
                      },
                      ackMessageId: {
                        type: "uint64",
                        id: 6
                      },
                      msgConfig: {
                        type: "MessageConfig",
                        id: 7
                      },
                      ackContent: {
                        type: "string",
                        id: 8
                      }
                    },
                    nested: {
                      Content: {
                        fields: {
                          type: {
                            type: "Type",
                            id: 1
                          },
                          text: {
                            type: "string",
                            id: 2
                          },
                          latitude: {
                            type: "double",
                            id: 3
                          },
                          longitude: {
                            type: "double",
                            id: 4
                          },
                          address: {
                            type: "string",
                            id: 5
                          },
                          displayName: {
                            type: "string",
                            id: 6
                          },
                          remotePath: {
                            type: "string",
                            id: 7
                          },
                          secretKey: {
                            type: "string",
                            id: 8
                          },
                          fileLength: {
                            type: "int32",
                            id: 9
                          },
                          action: {
                            type: "string",
                            id: 10
                          },
                          params: {
                            rule: "repeated",
                            type: "KeyValue",
                            id: 11
                          },
                          duration: {
                            type: "int32",
                            id: 12
                          },
                          size: {
                            type: "Size",
                            id: 13
                          },
                          thumbnailRemotePath: {
                            type: "string",
                            id: 14
                          },
                          thumbnailSecretKey: {
                            type: "string",
                            id: 15
                          },
                          thumbnailDisplayName: {
                            type: "string",
                            id: 16
                          },
                          thumbnailFileLength: {
                            type: "int32",
                            id: 17
                          },
                          thumbnailSize: {
                            type: "Size",
                            id: 18
                          },
                          customEvent: {
                            type: "string",
                            id: 19
                          },
                          customExts: {
                            rule: "repeated",
                            type: "KeyValue",
                            id: 20
                          }
                        },
                        nested: {
                          Type: {
                            values: {
                              TEXT: 0,
                              IMAGE: 1,
                              VIDEO: 2,
                              LOCATION: 3,
                              VOICE: 4,
                              FILE: 5,
                              COMMAND: 6,
                              CUSTOM: 7
                            }
                          },
                          Size: {
                            fields: {
                              width: {
                                type: "double",
                                id: 1
                              },
                              height: {
                                type: "double",
                                id: 2
                              }
                            }
                          }
                        }
                      },
                      Type: {
                        values: {
                          NORMAL: 0,
                          CHAT: 1,
                          GROUPCHAT: 2,
                          CHATROOM: 3,
                          READ_ACK: 4,
                          DELIVER_ACK: 5,
                          RECALL: 6
                        }
                      },
                      MessageConfig: {
                        fields: {
                          allowGroupAck: {
                            type: "bool",
                            id: 1
                          }
                        }
                      }
                    }
                  },
                  KeyValue: {
                    oneofs: {
                      value: {
                        oneof: ["varintValue", "floatValue", "doubleValue", "stringValue"]
                      }
                    },
                    fields: {
                      key: {
                        type: "string",
                        id: 1
                      },
                      type: {
                        type: "ValueType",
                        id: 2
                      },
                      varintValue: {
                        type: "int64",
                        id: 3
                      },
                      floatValue: {
                        type: "float",
                        id: 4
                      },
                      doubleValue: {
                        type: "double",
                        id: 5
                      },
                      stringValue: {
                        type: "string",
                        id: 6
                      }
                    },
                    nested: {
                      ValueType: {
                        values: {
                          BOOL: 1,
                          INT: 2,
                          UINT: 3,
                          LLINT: 4,
                          FLOAT: 5,
                          DOUBLE: 6,
                          STRING: 7,
                          JSON_STRING: 8
                        }
                      }
                    }
                  },
                  JID: {
                    fields: {
                      appKey: {
                        type: "string",
                        id: 1
                      },
                      name: {
                        type: "string",
                        id: 2
                      },
                      domain: {
                        type: "string",
                        id: 3
                      },
                      clientResource: {
                        type: "string",
                        id: 4
                      }
                    }
                  },
                  ConferenceBody: {
                    fields: {
                      sessionId: {
                        type: "string",
                        id: 1
                      },
                      operation: {
                        type: "Operation",
                        id: 2
                      },
                      conferenceId: {
                        type: "string",
                        id: 3
                      },
                      type: {
                        type: "Type",
                        id: 4
                      },
                      content: {
                        type: "string",
                        id: 5
                      },
                      network: {
                        type: "string",
                        id: 6
                      },
                      version: {
                        type: "string",
                        id: 7
                      },
                      identity: {
                        type: "Identity",
                        id: 8
                      },
                      duration: {
                        type: "string",
                        id: 9
                      },
                      peerName: {
                        type: "string",
                        id: 10
                      },
                      endReason: {
                        type: "EndReason",
                        id: 11
                      },
                      status: {
                        type: "Status",
                        id: 12
                      },
                      isDirect: {
                        type: "bool",
                        id: 13
                      },
                      controlType: {
                        type: "StreamControlType",
                        id: 14
                      },
                      routeFlag: {
                        type: "int32",
                        id: 15
                      },
                      routeKey: {
                        type: "string",
                        id: 16
                      }
                    },
                    nested: {
                      Status: {
                        fields: {
                          errorCode: {
                            type: "int32",
                            id: 1
                          }
                        }
                      },
                      Operation: {
                        values: {
                          JOIN: 0,
                          INITIATE: 1,
                          ACCEPT_INITIATE: 2,
                          ANSWER: 3,
                          TERMINATE: 4,
                          REMOVE: 5,
                          STREAM_CONTROL: 6,
                          MEDIA_REQUEST: 7
                        }
                      },
                      Type: {
                        values: {
                          VOICE: 0,
                          VIDEO: 1
                        }
                      },
                      Identity: {
                        values: {
                          CALLER: 0,
                          CALLEE: 1
                        }
                      },
                      EndReason: {
                        values: {
                          HANGUP: 0,
                          NORESPONSE: 1,
                          REJECT: 2,
                          BUSY: 3,
                          FAIL: 4,
                          UNSUPPORTED: 5,
                          OFFLINE: 6
                        }
                      },
                      StreamControlType: {
                        values: {
                          PAUSE_VOICE: 0,
                          RESUME_VOICE: 1,
                          PAUSE_VIDEO: 2,
                          RESUME_VIDEO: 3
                        }
                      }
                    }
                  },
                  MSync: {
                    fields: {
                      version: {
                        type: "Version",
                        id: 1,
                        options: {
                          default: "MSYNC_V1"
                        }
                      },
                      guid: {
                        type: "JID",
                        id: 2
                      },
                      auth: {
                        type: "string",
                        id: 3
                      },
                      compressAlgorimth: {
                        type: "uint32",
                        id: 4
                      },
                      crypto: {
                        type: "uint32",
                        id: 5
                      },
                      userAgent: {
                        type: "string",
                        id: 6
                      },
                      pov: {
                        type: "uint64",
                        id: 7
                      },
                      command: {
                        type: "Command",
                        id: 8
                      },
                      deviceId: {
                        type: "uint32",
                        id: 10
                      },
                      encryptType: {
                        rule: "repeated",
                        type: "EncryptType",
                        id: 11,
                        options: {
                          packed: !1
                        }
                      },
                      encryptKey: {
                        type: "string",
                        id: 12
                      },
                      payload: {
                        type: "bytes",
                        id: 9
                      }
                    },
                    nested: {
                      Version: {
                        values: {
                          MSYNC_V1: 0,
                          MSYNC_V2: 1
                        }
                      },
                      Command: {
                        values: {
                          SYNC: 0,
                          UNREAD: 1,
                          NOTICE: 2,
                          PROVISION: 3
                        }
                      }
                    }
                  },
                  EncryptType: {
                    values: {
                      ENCRYPT_NONE: 0,
                      ENCRYPT_AES_128_CBC: 1,
                      ENCRYPT_AES_256_CBC: 2
                    }
                  },
                  CommSyncUL: {
                    fields: {
                      meta: {
                        type: "Meta",
                        id: 1
                      },
                      key: {
                        type: "uint64",
                        id: 2
                      },
                      queue: {
                        type: "JID",
                        id: 3
                      },
                      isRoam: {
                        type: "bool",
                        id: 4
                      },
                      lastFullRoamKey: {
                        type: "uint64",
                        id: 5
                      }
                    }
                  },
                  CommSyncDL: {
                    fields: {
                      status: {
                        type: "Status",
                        id: 1
                      },
                      metaId: {
                        type: "uint64",
                        id: 2
                      },
                      serverId: {
                        type: "uint64",
                        id: 3
                      },
                      metas: {
                        rule: "repeated",
                        type: "Meta",
                        id: 4
                      },
                      nextKey: {
                        type: "uint64",
                        id: 5
                      },
                      queue: {
                        type: "JID",
                        id: 6
                      },
                      isLast: {
                        type: "bool",
                        id: 7
                      },
                      timestamp: {
                        type: "uint64",
                        id: 8
                      },
                      isRoam: {
                        type: "bool",
                        id: 9
                      }
                    }
                  },
                  CommNotice: {
                    fields: {
                      queue: {
                        type: "JID",
                        id: 1
                      }
                    }
                  },
                  CommUnreadUL: {
                    fields: {}
                  },
                  CommUnreadDL: {
                    fields: {
                      status: {
                        type: "Status",
                        id: 1
                      },
                      unread: {
                        rule: "repeated",
                        type: "MetaQueue",
                        id: 2
                      },
                      timestamp: {
                        type: "uint64",
                        id: 3
                      }
                    }
                  },
                  MetaQueue: {
                    fields: {
                      queue: {
                        type: "JID",
                        id: 1
                      },
                      n: {
                        type: "uint32",
                        id: 2
                      }
                    }
                  },
                  Meta: {
                    fields: {
                      id: {
                        type: "uint64",
                        id: 1
                      },
                      from: {
                        type: "JID",
                        id: 2
                      },
                      to: {
                        type: "JID",
                        id: 3
                      },
                      timestamp: {
                        type: "uint64",
                        id: 4
                      },
                      ns: {
                        type: "NameSpace",
                        id: 5
                      },
                      payload: {
                        type: "bytes",
                        id: 6
                      },
                      routetype: {
                        type: "RouteType",
                        id: 7
                      }
                    },
                    nested: {
                      NameSpace: {
                        values: {
                          STATISTIC: 0,
                          CHAT: 1,
                          MUC: 2,
                          ROSTER: 3,
                          CONFERENCE: 4
                        }
                      },
                      RouteType: {
                        values: {
                          ROUTE_ALL: 0,
                          ROUTE_ONLINE: 1
                        }
                      }
                    }
                  },
                  Status: {
                    fields: {
                      errorCode: {
                        type: "ErrorCode",
                        id: 1
                      },
                      reason: {
                        type: "string",
                        id: 2
                      },
                      redirectInfo: {
                        rule: "repeated",
                        type: "RedirectInfo",
                        id: 3
                      }
                    },
                    nested: {
                      ErrorCode: {
                        values: {
                          OK: 0,
                          FAIL: 1,
                          UNAUTHORIZED: 2,
                          MISSING_PARAMETER: 3,
                          WRONG_PARAMETER: 4,
                          REDIRECT: 5,
                          TOKEN_EXPIRED: 6,
                          PERMISSION_DENIED: 7,
                          NO_ROUTE: 8,
                          UNKNOWN_COMMAND: 9,
                          PB_PARSER_ERROR: 10,
                          BIND_ANOTHER_DEVICE: 11,
                          IM_FORBIDDEN: 12,
                          TOO_MANY_DEVICES: 13,
                          PLATFORM_LIMIT: 14,
                          USER_MUTED: 15,
                          ENCRYPT_DISABLE: 16,
                          ENCRYPT_ENABLE: 17,
                          DECRYPT_FAILURE: 18
                        }
                      }
                    }
                  },
                  RedirectInfo: {
                    fields: {
                      host: {
                        type: "string",
                        id: 1
                      },
                      port: {
                        type: "uint32",
                        id: 2
                      }
                    }
                  },
                  Provision: {
                    fields: {
                      osType: {
                        type: "OsType",
                        id: 1
                      },
                      version: {
                        type: "string",
                        id: 2
                      },
                      networkType: {
                        type: "NetworkType",
                        id: 3
                      },
                      appSign: {
                        type: "string",
                        id: 4
                      },
                      compressType: {
                        rule: "repeated",
                        type: "CompressType",
                        id: 5,
                        options: {
                          packed: !1
                        }
                      },
                      encryptType: {
                        rule: "repeated",
                        type: "EncryptType",
                        id: 6,
                        options: {
                          packed: !1
                        }
                      },
                      encryptKey: {
                        type: "string",
                        id: 7
                      },
                      status: {
                        type: "Status",
                        id: 8
                      },
                      deviceUuid: {
                        type: "string",
                        id: 9
                      },
                      isManualLogin: {
                        type: "bool",
                        id: 10
                      },
                      password: {
                        type: "string",
                        id: 11
                      },
                      deviceName: {
                        type: "string",
                        id: 12
                      },
                      resource: {
                        type: "string",
                        id: 13
                      },
                      auth: {
                        type: "string",
                        id: 14
                      }
                    },
                    nested: {
                      OsType: {
                        values: {
                          OS_IOS: 0,
                          OS_ANDROID: 1,
                          OS_LINUX: 2,
                          OS_OSX: 3,
                          OS_WIN: 4,
                          OS_OTHER: 16
                        }
                      },
                      NetworkType: {
                        values: {
                          NETWORK_NONE: 0,
                          NETWORK_WIFI: 1,
                          NETWORK_4G: 2,
                          NETWORK_3G: 3,
                          NETWORK_2G: 4,
                          NETWORK_WIRE: 5
                        }
                      },
                      CompressType: {
                        values: {
                          COMPRESS_NONE: 0,
                          COMPRESS_ZLIB: 1
                        }
                      }
                    }
                  },
                  MUCBody: {
                    fields: {
                      mucId: {
                        type: "JID",
                        id: 1
                      },
                      operation: {
                        type: "Operation",
                        id: 2
                      },
                      from: {
                        type: "JID",
                        id: 3
                      },
                      to: {
                        rule: "repeated",
                        type: "JID",
                        id: 4
                      },
                      setting: {
                        type: "Setting",
                        id: 5
                      },
                      reason: {
                        type: "string",
                        id: 6
                      },
                      isChatroom: {
                        type: "bool",
                        id: 7
                      },
                      status: {
                        type: "Status",
                        id: 8
                      }
                    },
                    nested: {
                      Operation: {
                        values: {
                          CREATE: 0,
                          DESTROY: 1,
                          JOIN: 2,
                          LEAVE: 3,
                          APPLY: 4,
                          APPLY_ACCEPT: 5,
                          APPLY_DECLINE: 6,
                          INVITE: 7,
                          INVITE_ACCEPT: 8,
                          INVITE_DECLINE: 9,
                          KICK: 10,
                          GET_BLACKLIST: 11,
                          BAN: 12,
                          ALLOW: 13,
                          UPDATE: 14,
                          BLOCK: 15,
                          UNBLOCK: 16,
                          PRESENCE: 17,
                          ABSENCE: 18,
                          DIRECT_JOINED: 19,
                          ASSIGN_OWNER: 20,
                          ADD_ADMIN: 21,
                          REMOVE_ADMIN: 22,
                          ADD_MUTE: 23,
                          REMOVE_MUTE: 24,
                          UPDATE_ANNOUNCEMENT: 25,
                          DELETE_ANNOUNCEMENT: 26,
                          UPLOAD_FILE: 27,
                          DELETE_FILE: 28,
                          ADD_USER_WHITE_LIST: 29,
                          REMOVE_USER_WHITE_LIST: 30,
                          BAN_GROUP: 31,
                          REMOVE_BAN_GROUP: 32
                        }
                      },
                      Setting: {
                        fields: {
                          name: {
                            type: "string",
                            id: 1
                          },
                          desc: {
                            type: "string",
                            id: 2
                          },
                          type: {
                            type: "Type",
                            id: 3
                          },
                          maxUsers: {
                            type: "int32",
                            id: 4
                          },
                          owner: {
                            type: "string",
                            id: 5
                          }
                        },
                        nested: {
                          Type: {
                            values: {
                              PRIVATE_OWNER_INVITE: 0,
                              PRIVATE_MEMBER_INVITE: 1,
                              PUBLIC_JOIN_APPROVAL: 2,
                              PUBLIC_JOIN_OPEN: 3,
                              PUBLIC_ANONYMOUS: 4
                            }
                          }
                        }
                      },
                      Status: {
                        fields: {
                          errorCode: {
                            type: "ErrorCode",
                            id: 1
                          },
                          description: {
                            type: "string",
                            id: 2
                          }
                        },
                        nested: {
                          ErrorCode: {
                            values: {
                              OK: 0,
                              PERMISSION_DENIED: 1,
                              WRONG_PARAMETER: 2,
                              MUC_NOT_EXIST: 3,
                              USER_NOT_EXIST: 4,
                              UNKNOWN: 5
                            }
                          }
                        }
                      }
                    }
                  },
                  RosterBody: {
                    fields: {
                      operation: {
                        type: "Operation",
                        id: 1
                      },
                      status: {
                        type: "Status",
                        id: 2
                      },
                      from: {
                        type: "JID",
                        id: 3
                      },
                      to: {
                        rule: "repeated",
                        type: "JID",
                        id: 4
                      },
                      reason: {
                        type: "string",
                        id: 5
                      },
                      rosterVer: {
                        type: "string",
                        id: 6
                      },
                      biDirection: {
                        type: "bool",
                        id: 7
                      }
                    },
                    nested: {
                      Operation: {
                        values: {
                          GET_ROSTER: 0,
                          GET_BLACKLIST: 1,
                          ADD: 2,
                          REMOVE: 3,
                          ACCEPT: 4,
                          DECLINE: 5,
                          BAN: 6,
                          ALLOW: 7,
                          REMOTE_ACCEPT: 8,
                          REMOTE_DECLINE: 9
                        }
                      },
                      Status: {
                        fields: {
                          errorCode: {
                            type: "ErrorCode",
                            id: 1
                          },
                          description: {
                            type: "string",
                            id: 2
                          }
                        },
                        nested: {
                          ErrorCode: {
                            values: {
                              OK: 0,
                              USER_NOT_EXIST: 1,
                              USER_ALREADY_FRIEND: 2,
                              USER_ALREADY_BLACKLIST: 3
                            }
                          }
                        }
                      }
                    }
                  },
                  StatisticsBody: {
                    fields: {
                      operation: {
                        type: "Operation",
                        id: 1
                      },
                      os: {
                        type: "OsType",
                        id: 2
                      },
                      version: {
                        type: "string",
                        id: 3
                      },
                      network: {
                        type: "NetworkType",
                        id: 4
                      },
                      imTime: {
                        type: "uint32",
                        id: 5
                      },
                      chatTime: {
                        type: "uint32",
                        id: 6
                      },
                      location: {
                        type: "string",
                        id: 7
                      }
                    },
                    nested: {
                      Operation: {
                        values: {
                          INFORMATION: 0,
                          USER_REMOVED: 1,
                          USER_LOGIN_ANOTHER_DEVICE: 2,
                          USER_KICKED_BY_CHANGE_PASSWORD: 3,
                          USER_KICKED_BY_OTHER_DEVICE: 4
                        }
                      },
                      OsType: {
                        values: {
                          OS_IOS: 0,
                          OS_ANDROID: 1,
                          OS_LINUX: 2,
                          OS_OSX: 3,
                          OS_WIN: 4,
                          OS_OTHER: 16
                        }
                      },
                      NetworkType: {
                        values: {
                          NETWORK_NONE: 0,
                          NETWORK_WIFI: 1,
                          NETWORK_4G: 2,
                          NETWORK_3G: 3,
                          NETWORK_2G: 4,
                          NETWORK_WIRE: 5
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      };
    };

    t.default = i;
  }, function (e, t, r) {
    "use strict";

    e.exports = o;
    var i = r(2);

    function o(e, t) {
      this.lo = e >>> 0, this.hi = t >>> 0;
    }

    var n = o.zero = new o(0, 0);
    n.toNumber = function () {
      return 0;
    }, n.zzEncode = n.zzDecode = function () {
      return this;
    }, n.length = function () {
      return 1;
    };
    var s = o.zeroHash = "\0\0\0\0\0\0\0\0";
    o.fromNumber = function (e) {
      if (0 === e) return n;
      var t = e < 0;
      t && (e = -e);
      var r = e >>> 0,
          i = (e - r) / 4294967296 >>> 0;
      return t && (i = ~i >>> 0, r = ~r >>> 0, ++r > 4294967295 && (r = 0, ++i > 4294967295 && (i = 0))), new o(r, i);
    }, o.from = function (e) {
      if ("number" == typeof e) return o.fromNumber(e);

      if ("string" == typeof e || e instanceof String) {
        if (!i.Long) return o.fromNumber(parseInt(e, 10));
        e = i.Long.fromString(e);
      }

      return e.low || e.high ? new o(e.low >>> 0, e.high >>> 0) : n;
    }, o.prototype.toNumber = function (e) {
      if (!e && this.hi >>> 31) {
        var t = 1 + ~this.lo >>> 0,
            r = ~this.hi >>> 0;
        return t || (r = r + 1 >>> 0), -(t + 4294967296 * r);
      }

      return this.lo + 4294967296 * this.hi;
    }, o.prototype.toLong = function (e) {
      return i.Long ? new i.Long(0 | this.lo, 0 | this.hi, Boolean(e)) : {
        low: 0 | this.lo,
        high: 0 | this.hi,
        unsigned: Boolean(e)
      };
    };
    var a = String.prototype.charCodeAt;
    o.fromHash = function (e) {
      return e === s ? n : new o((a.call(e, 0) | a.call(e, 1) << 8 | a.call(e, 2) << 16 | a.call(e, 3) << 24) >>> 0, (a.call(e, 4) | a.call(e, 5) << 8 | a.call(e, 6) << 16 | a.call(e, 7) << 24) >>> 0);
    }, o.prototype.toHash = function () {
      return String.fromCharCode(255 & this.lo, this.lo >>> 8 & 255, this.lo >>> 16 & 255, this.lo >>> 24, 255 & this.hi, this.hi >>> 8 & 255, this.hi >>> 16 & 255, this.hi >>> 24);
    }, o.prototype.zzEncode = function () {
      var e = this.hi >> 31;
      return this.hi = ((this.hi << 1 | this.lo >>> 31) ^ e) >>> 0, this.lo = (this.lo << 1 ^ e) >>> 0, this;
    }, o.prototype.zzDecode = function () {
      var e = -(1 & this.lo);
      return this.lo = ((this.lo >>> 1 | this.hi << 31) ^ e) >>> 0, this.hi = (this.hi >>> 1 ^ e) >>> 0, this;
    }, o.prototype.length = function () {
      var e = this.lo,
          t = (this.lo >>> 28 | this.hi << 4) >>> 0,
          r = this.hi >>> 24;
      return 0 === r ? 0 === t ? e < 16384 ? e < 128 ? 1 : 2 : e < 2097152 ? 3 : 4 : t < 16384 ? t < 128 ? 5 : 6 : t < 2097152 ? 7 : 8 : r < 128 ? 9 : 10;
    };
  }, function (e, t, r) {
    "use strict";

    var i = r(1)(r(6));
    e.exports = a;
    var o,
        n,
        s = r(15);

    function a(e, t, r, i, o, a) {
      if (s.call(this, e, t, i, void 0, void 0, o, a), !n.isString(r)) throw TypeError("keyType must be a string");
      this.keyType = r, this.resolvedKeyType = null, this.map = !0;
    }

    ((a.prototype = Object.create(s.prototype)).constructor = a).className = "MapField", a.fromJSON = function (e, t) {
      return new a(e, t.id, t.keyType, t.type, t.options, t.comment);
    }, a.prototype.toJSON = function (e) {
      var t = !!e && Boolean(e.keepComments);
      return n.toObject(["keyType", this.keyType, "type", this.type, "id", this.id, "extend", this.extend, "options", this.options, "comment", t ? this.comment : void 0]);
    }, a.prototype.resolve = function () {
      if (this.resolved) return this;
      if (void 0 === o.mapKey[this.keyType]) throw Error("invalid key type: " + this.keyType);
      return s.prototype.resolve.call(this);
    }, a.d = function (e, t, r) {
      return "function" == typeof r ? r = n.decorateType(r).name : r && "object" === (0, i.default)(r) && (r = n.decorateEnum(r).name), function (i, o) {
        n.decorateType(i.constructor).add(new a(o, e, t, r));
      };
    }, a._configure = function () {
      o = r(23), n = r(2);
    };
  }, function (e, t, r) {
    "use strict";

    e.exports = n;
    var i,
        o = r(22);

    function n(e, t, r, n, s, a, u, p) {
      if (i.isObject(s) ? (u = s, s = a = void 0) : i.isObject(a) && (u = a, a = void 0), void 0 !== t && !i.isString(t)) throw TypeError("type must be a string");
      if (!i.isString(r)) throw TypeError("requestType must be a string");
      if (!i.isString(n)) throw TypeError("responseType must be a string");
      o.call(this, e, u), this.type = t || "rpc", this.requestType = r, this.requestStream = !!s || void 0, this.responseType = n, this.responseStream = !!a || void 0, this.resolvedRequestType = null, this.resolvedResponseType = null, this.comment = p;
    }

    ((n.prototype = Object.create(o.prototype)).constructor = n).className = "Method", n.fromJSON = function (e, t) {
      return new n(e, t.type, t.requestType, t.responseType, t.requestStream, t.responseStream, t.options, t.comment);
    }, n.prototype.toJSON = function (e) {
      var t = !!e && Boolean(e.keepComments);
      return i.toObject(["type", "rpc" !== this.type && this.type || void 0, "requestType", this.requestType, "requestStream", this.requestStream, "responseType", this.responseType, "responseStream", this.responseStream, "options", this.options, "comment", t ? this.comment : void 0]);
    }, n.prototype.resolve = function () {
      return this.resolved ? this : (this.resolvedRequestType = this.parent.lookupType(this.requestType), this.resolvedResponseType = this.parent.lookupType(this.responseType), o.prototype.resolve.call(this));
    }, n._configure = function () {
      i = r(2);
    };
  }, function (e, t, r) {
    "use strict";

    var i;

    function o(e) {
      if (e) for (var t = Object.keys(e), r = 0; r < t.length; ++r) this[t[r]] = e[t[r]];
    }

    e.exports = o, o.create = function (e) {
      return this.$type.create(e);
    }, o.encode = function (e, t) {
      return arguments.length ? 1 == arguments.length ? this.$type.encode(arguments[0]) : this.$type.encode(arguments[0], arguments[1]) : this.$type.encode(this);
    }, o.encodeDelimited = function (e, t) {
      return this.$type.encodeDelimited(e, t);
    }, o.decode = function (e) {
      return this.$type.decode(e);
    }, o.decodeDelimited = function (e) {
      return this.$type.decodeDelimited(e);
    }, o.verify = function (e) {
      return this.$type.verify(e);
    }, o.fromObject = function (e) {
      return this.$type.fromObject(e);
    }, o.toObject = function (e, t) {
      return e = e || this, this.$type.toObject(e, t);
    }, o.prototype.toJSON = function () {
      return this.$type.toObject(this, i.toJSONOptions);
    }, o.set = function (e, t) {
      o[e] = t;
    }, o.get = function (e) {
      return o[e];
    }, o._configure = function () {
      i = r(2);
    };
  },,,,,,,,,,,,,,,,,,,,,,,,, function (e, t, r) {
    "use strict";

    e.exports = p;
    var i,
        o = r(2),
        n = r(37);

    function s(e, t, r) {
      this.fn = e, this.len = t, this.next = void 0, this.val = r;
    }

    function a() {}

    function u(e) {
      this.head = e.head, this.tail = e.tail, this.len = e.len, this.next = e.states;
    }

    function p() {
      this.len = 0, this.head = new s(a, 0, 0), this.tail = this.head, this.states = null;
    }

    function l(e, t, r) {
      t[r] = 255 & e;
    }

    function c(e, t) {
      this.len = e, this.next = void 0, this.val = t;
    }

    function h(e, t, r) {
      for (; e.hi;) t[r++] = 127 & e.lo | 128, e.lo = (e.lo >>> 7 | e.hi << 25) >>> 0, e.hi >>>= 7;

      for (; e.lo > 127;) t[r++] = 127 & e.lo | 128, e.lo = e.lo >>> 7;

      t[r++] = e.lo;
    }

    function f(e, t, r) {
      t[r] = 255 & e, t[r + 1] = e >>> 8 & 255, t[r + 2] = e >>> 16 & 255, t[r + 3] = e >>> 24;
    }

    p.create = o.Buffer ? function () {
      return (p.create = function () {
        return new (void 0)();
      })();
    } : function () {
      return new p();
    }, p.alloc = function (e) {
      return new o.Array(e);
    }, o.Array !== Array && (p.alloc = o.pool(p.alloc, o.Array.prototype.subarray)), p.prototype._push = function (e, t, r) {
      return this.tail = this.tail.next = new s(e, t, r), this.len += t, this;
    }, c.prototype = Object.create(s.prototype), c.prototype.fn = function (e, t, r) {
      for (; e > 127;) t[r++] = 127 & e | 128, e >>>= 7;

      t[r] = e;
    }, p.prototype.uint32 = function (e) {
      return this.len += (this.tail = this.tail.next = new c((e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 2097152 ? 3 : e < 268435456 ? 4 : 5, e)).len, this;
    }, p.prototype.int32 = function (e) {
      return e < 0 ? this._push(h, 10, i.fromNumber(e)) : this.uint32(e);
    }, p.prototype.sint32 = function (e) {
      return this.uint32((e << 1 ^ e >> 31) >>> 0);
    }, p.prototype.uint64 = function (e) {
      var t = i.from(e);
      return this._push(h, t.length(), t);
    }, p.prototype.int64 = p.prototype.uint64, p.prototype.sint64 = function (e) {
      var t = i.from(e).zzEncode();
      return this._push(h, t.length(), t);
    }, p.prototype.bool = function (e) {
      return this._push(l, 1, e ? 1 : 0);
    }, p.prototype.fixed32 = function (e) {
      return this._push(f, 4, e >>> 0);
    }, p.prototype.sfixed32 = p.prototype.fixed32, p.prototype.fixed64 = function (e) {
      var t = i.from(e);
      return this._push(f, 4, t.lo)._push(f, 4, t.hi);
    }, p.prototype.sfixed64 = p.prototype.fixed64, p.prototype.float = function (e) {
      return this._push(o.float.writeFloatLE, 4, e);
    }, p.prototype.double = function (e) {
      return this._push(o.float.writeDoubleLE, 8, e);
    };
    var d = o.Array.prototype.set ? function (e, t, r) {
      t.set(e, r);
    } : function (e, t, r) {
      for (var i = 0; i < e.length; ++i) t[r + i] = e[i];
    };
    p.prototype.bytes = function (e) {
      var t = e.length >>> 0;
      if (!t) return this._push(l, 1, 0);

      if (o.isString(e)) {
        var r = p.alloc(t = n.length(e));
        n.write(e, r, 0), e = r;
      }

      return this.uint32(t)._push(d, t, e);
    }, p.prototype.string = function (e) {
      var t = n.length(e);
      return t ? this.uint32(t)._push(n.write, t, e) : this._push(l, 1, 0);
    }, p.prototype.fork = function () {
      return this.states = new u(this), this.head = this.tail = new s(a, 0, 0), this.len = 0, this;
    }, p.prototype.reset = function () {
      return this.states ? (this.head = this.states.head, this.tail = this.states.tail, this.len = this.states.len, this.states = this.states.next) : (this.head = this.tail = new s(a, 0, 0), this.len = 0), this;
    }, p.prototype.ldelim = function () {
      var e = this.head,
          t = this.tail,
          r = this.len;
      return this.reset().uint32(r), r && (this.tail.next = e.next, this.tail = t, this.len += r), this;
    }, p.prototype.finish = function () {
      for (var e = this.head.next, t = this.constructor.alloc(this.len), r = 0; e;) e.fn(e.val, t, r), r += e.len, e = e.next;

      return t;
    }, p._configure = function () {
      i = r(61), r(91), n = r(37);
    };
  }, function (e, t, r) {
    "use strict";

    e.exports = {};
  }, function (e, t, r) {
    "use strict";

    var i = e.exports;

    i.length = function (e) {
      var t = e.length;
      if (!t) return 0;

      for (var r = 0; --t % 4 > 1 && "=" === e.charAt(t);) ++r;

      return Math.ceil(3 * e.length) / 4 - r;
    };

    for (var o = new Array(64), n = new Array(123), s = 0; s < 64;) n[o[s] = s < 26 ? s + 65 : s < 52 ? s + 71 : s < 62 ? s - 4 : s - 59 | 43] = s++;

    i.encode = function (e, t, r) {
      for (var i, n = null, s = [], a = 0, u = 0; t < r;) {
        var p = e[t++];

        switch (u) {
          case 0:
            s[a++] = o[p >> 2], i = (3 & p) << 4, u = 1;
            break;

          case 1:
            s[a++] = o[i | p >> 4], i = (15 & p) << 2, u = 2;
            break;

          case 2:
            s[a++] = o[i | p >> 6], s[a++] = o[63 & p], u = 0;
        }

        a > 8191 && ((n || (n = [])).push(String.fromCharCode.apply(String, s)), a = 0);
      }

      return u && (s[a++] = o[i], s[a++] = 61, 1 === u && (s[a++] = 61)), n ? (a && n.push(String.fromCharCode.apply(String, s.slice(0, a))), n.join("")) : String.fromCharCode.apply(String, s.slice(0, a));
    };

    i.decode = function (e, t, r) {
      for (var i, o = r, s = 0, a = 0; a < e.length;) {
        var u = e.charCodeAt(a++);
        if (61 === u && s > 1) break;
        if (void 0 === (u = n[u])) throw Error("invalid encoding");

        switch (s) {
          case 0:
            i = u, s = 1;
            break;

          case 1:
            t[r++] = i << 2 | (48 & u) >> 4, i = u, s = 2;
            break;

          case 2:
            t[r++] = (15 & i) << 4 | (60 & u) >> 2, i = u, s = 3;
            break;

          case 3:
            t[r++] = (3 & i) << 6 | u, s = 0;
        }
      }

      if (1 === s) throw Error("invalid encoding");
      return r - o;
    }, i.test = function (e) {
      return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e);
    };
  }, function (e, t, r) {
    "use strict";

    var i, o, n, s, a, u, p, l, c, h, f;
    e.exports = T, T.filename = null, T.defaults = {
      keepCase: !1
    };
    var d = /^[1-9][0-9]*$/,
        y = /^-?[1-9][0-9]*$/,
        m = /^0[x][0-9a-fA-F]+$/,
        g = /^-?0[x][0-9a-fA-F]+$/,
        v = /^0[0-7]+$/,
        _ = /^-?0[0-7]+$/,
        E = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,
        O = /^[a-zA-Z_][a-zA-Z_0-9]*$/,
        N = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
        b = /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/;

    function T(e, t, r) {
      t instanceof o || (r = t, t = new o()), r || (r = T.defaults);
      var I,
          R,
          S,
          C,
          w,
          A = i(e, r.alternateCommentMode || !1),
          x = A.next,
          k = A.push,
          j = A.peek,
          M = A.skip,
          U = A.cmnt,
          B = !0,
          D = !1,
          L = t,
          P = r.keepCase ? function (e) {
        return e;
      } : f.camelCase;

      function F(e, t, r) {
        var i = T.filename;
        return r || (T.filename = null), Error("illegal " + (t || "token") + " '" + e + "' (" + (i ? i + ", " : "") + "line " + A.line + ")");
      }

      function W() {
        var e,
            t = [];

        do {
          if ('"' !== (e = x()) && "'" !== e) throw F(e);
          t.push(x()), M(e), e = j();
        } while ('"' === e || "'" === e);

        return t.join("");
      }

      function G(e) {
        var t = x();

        switch (t) {
          case "'":
          case '"':
            return k(t), W();

          case "true":
          case "TRUE":
            return !0;

          case "false":
          case "FALSE":
            return !1;
        }

        try {
          return function (e, t) {
            var r = 1;
            "-" === e.charAt(0) && (r = -1, e = e.substring(1));

            switch (e) {
              case "inf":
              case "INF":
              case "Inf":
                return r * (1 / 0);

              case "nan":
              case "NAN":
              case "Nan":
              case "NaN":
                return NaN;

              case "0":
                return 0;
            }

            if (d.test(e)) return r * parseInt(e, 10);
            if (m.test(e)) return r * parseInt(e, 16);
            if (v.test(e)) return r * parseInt(e, 8);
            if (E.test(e)) return r * parseFloat(e);
            throw F(e, "number", t);
          }(t, !0);
        } catch (r) {
          if (e && N.test(t)) return t;
          throw F(t, "value");
        }
      }

      function q(e, t) {
        var r, i;

        do {
          !t || '"' !== (r = j()) && "'" !== r ? e.push([i = z(x()), M("to", !0) ? z(x()) : i]) : e.push(W());
        } while (M(",", !0));

        M(";");
      }

      function z(e, t) {
        switch (e) {
          case "max":
          case "MAX":
          case "Max":
            return 536870911;

          case "0":
            return 0;
        }

        if (!t && "-" === e.charAt(0)) throw F(e, "id");
        if (y.test(e)) return parseInt(e, 10);
        if (g.test(e)) return parseInt(e, 16);
        if (_.test(e)) return parseInt(e, 8);
        throw F(e, "id");
      }

      function V() {
        if (void 0 !== I) throw F("package");
        if (I = x(), !N.test(I)) throw F(I, "name");
        L = L.define(I), M(";");
      }

      function K() {
        var e,
            t = j();

        switch (t) {
          case "weak":
            e = S || (S = []), x();
            break;

          case "public":
            x();

          default:
            e = R || (R = []);
        }

        t = W(), M(";"), e.push(t);
      }

      function J() {
        if (M("="), C = W(), !(D = "proto3" === C) && "proto2" !== C) throw F(C, "syntax");
        M(";");
      }

      function H(e, t) {
        switch (t) {
          case "option":
            return Y(e, t), M(";"), !0;

          case "message":
            return function (e, t) {
              if (!O.test(t = x())) throw F(t, "type name");
              var r = new n(t);
              $(r, function (e) {
                if (!H(r, e)) switch (e) {
                  case "map":
                    !function (e) {
                      M("<");
                      var t = x();
                      if (void 0 === h.mapKey[t]) throw F(t, "type");
                      M(",");
                      var r = x();
                      if (!N.test(r)) throw F(r, "type");
                      M(">");
                      var i = x();
                      if (!O.test(i)) throw F(i, "name");
                      M("=");
                      var o = new a(P(i), z(x()), t, r);
                      $(o, function (e) {
                        if ("option" !== e) throw F(e);
                        Y(o, e), M(";");
                      }, function () {
                        ee(o);
                      }), e.add(o);
                    }(r);
                    break;

                  case "required":
                  case "optional":
                  case "repeated":
                    Z(r, e);
                    break;

                  case "oneof":
                    !function (e, t) {
                      if (!O.test(t = x())) throw F(t, "name");
                      var r = new u(P(t));
                      $(r, function (e) {
                        "option" === e ? (Y(r, e), M(";")) : (k(e), Z(r, "optional"));
                      }), e.add(r);
                    }(r, e);
                    break;

                  case "extensions":
                    q(r.extensions || (r.extensions = []));
                    break;

                  case "reserved":
                    q(r.reserved || (r.reserved = []), !0);
                    break;

                  default:
                    if (!D || !N.test(e)) throw F(e);
                    k(e), Z(r, "optional");
                }
              }), e.add(r);
            }(e, t), !0;

          case "enum":
            return function (e, t) {
              if (!O.test(t = x())) throw F(t, "name");
              var r = new p(t);
              $(r, function (e) {
                switch (e) {
                  case "option":
                    Y(r, e), M(";");
                    break;

                  case "reserved":
                    q(r.reserved || (r.reserved = []), !0);
                    break;

                  default:
                    !function (e, t) {
                      if (!O.test(t)) throw F(t, "name");
                      M("=");
                      var r = z(x(), !0),
                          i = {};
                      $(i, function (e) {
                        if ("option" !== e) throw F(e);
                        Y(i, e), M(";");
                      }, function () {
                        ee(i);
                      }), e.add(t, r, i.comment);
                    }(r, e);
                }
              }), e.add(r);
            }(e, t), !0;

          case "service":
            return function (e, t) {
              if (!O.test(t = x())) throw F(t, "service name");
              var r = new l(t);
              $(r, function (e) {
                if (!H(r, e)) {
                  if ("rpc" !== e) throw F(e);
                  !function (e, t) {
                    var r = t;
                    if (!O.test(t = x())) throw F(t, "name");
                    var i,
                        o,
                        n,
                        s,
                        a = t;
                    M("("), M("stream", !0) && (o = !0);
                    if (!N.test(t = x())) throw F(t);
                    i = t, M(")"), M("returns"), M("("), M("stream", !0) && (s = !0);
                    if (!N.test(t = x())) throw F(t);
                    n = t, M(")");
                    var u = new c(a, r, i, n, o, s);
                    $(u, function (e) {
                      if ("option" !== e) throw F(e);
                      Y(u, e), M(";");
                    }), e.add(u);
                  }(r, e);
                }
              }), e.add(r);
            }(e, t), !0;

          case "extend":
            return function (e, t) {
              if (!N.test(t = x())) throw F(t, "reference");
              var r = t;
              $(null, function (t) {
                switch (t) {
                  case "required":
                  case "repeated":
                  case "optional":
                    Z(e, t, r);
                    break;

                  default:
                    if (!D || !N.test(t)) throw F(t);
                    k(t), Z(e, "optional", r);
                }
              });
            }(e, t), !0;
        }

        return !1;
      }

      function $(e, t, r) {
        var i = A.line;

        if (e && (e.comment = U(), e.filename = T.filename), M("{", !0)) {
          for (var o; "}" !== (o = x());) t(o);

          M(";", !0);
        } else r && r(), M(";"), e && "string" != typeof e.comment && (e.comment = U(i));
      }

      function Z(e, t, r) {
        var i = x();

        if ("group" !== i) {
          if (!N.test(i)) throw F(i, "type");
          var o = x();
          if (!O.test(o)) throw F(o, "name");
          o = P(o), M("=");
          var a = new s(o, z(x()), i, t, r);
          $(a, function (e) {
            if ("option" !== e) throw F(e);
            Y(a, e), M(";");
          }, function () {
            ee(a);
          }), e.add(a), D || !a.repeated || void 0 === h.packed[i] && void 0 !== h.basic[i] || a.setOption("packed", !1, !0);
        } else !function (e, t) {
          var r = x();
          if (!O.test(r)) throw F(r, "name");
          var i = f.lcFirst(r);
          r === i && (r = f.ucFirst(r));
          M("=");
          var o = z(x()),
              a = new n(r);
          a.group = !0;
          var u = new s(i, o, r, t);
          u.filename = T.filename, $(a, function (e) {
            switch (e) {
              case "option":
                Y(a, e), M(";");
                break;

              case "required":
              case "optional":
              case "repeated":
                Z(a, e);
                break;

              default:
                throw F(e);
            }
          }), e.add(a).add(u);
        }(e, t);
      }

      function Y(e, t) {
        var r = M("(", !0);
        if (!N.test(t = x())) throw F(t, "name");
        var i = t;
        r && (M(")"), i = "(" + i + ")", t = j(), b.test(t) && (i += t, x())), M("="), X(e, i);
      }

      function X(e, t) {
        if (M("{", !0)) do {
          if (!O.test(w = x())) throw F(w, "name");
          "{" === j() ? X(e, t + "." + w) : (M(":"), "{" === j() ? X(e, t + "." + w) : Q(e, t + "." + w, G(!0)));
        } while (!M("}", !0));else Q(e, t, G(!0));
      }

      function Q(e, t, r) {
        e.setOption && e.setOption(t, r);
      }

      function ee(e) {
        if (M("[", !0)) {
          do {
            Y(e, "option");
          } while (M(",", !0));

          M("]");
        }

        return e;
      }

      for (; null !== (w = x());) switch (w) {
        case "package":
          if (!B) throw F(w);
          V();
          break;

        case "import":
          if (!B) throw F(w);
          K();
          break;

        case "syntax":
          if (!B) throw F(w);
          J();
          break;

        case "option":
          if (!B) throw F(w);
          Y(L, w), M(";");
          break;

        default:
          if (H(L, w)) {
            B = !1;
            continue;
          }

          throw F(w);
      }

      return T.filename = null, {
        package: I,
        imports: R,
        weakImports: S,
        syntax: C,
        root: t
      };
    }

    T._configure = function () {
      i = r(93), o = r(38), n = r(21), s = r(15), a = r(62), u = r(32), p = r(10), l = r(39), c = r(63), h = r(23), f = r(2);
    };
  }, function (e, t, r) {
    "use strict";

    e.exports = f;
    var i = /[\s{}=;:[\],'"()<>]/g,
        o = /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
        n = /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
        s = /^ *[*/]+ */,
        a = /^\s*\*?\/*/,
        u = /\n/g,
        p = /\s/,
        l = /\\(.?)/g,
        c = {
      0: "\0",
      r: "\r",
      n: "\n",
      t: "\t"
    };

    function h(e) {
      return e.replace(l, function (e, t) {
        switch (t) {
          case "\\":
          case "":
            return t;

          default:
            return c[t] || "";
        }
      });
    }

    function f(e, t) {
      e = e.toString();
      var r = 0,
          l = e.length,
          c = 1,
          f = null,
          d = null,
          y = 0,
          m = !1,
          g = [],
          v = null;

      function _(e) {
        return Error("illegal " + e + " (line " + c + ")");
      }

      function E(t) {
        return e.charAt(t);
      }

      function O(r, i) {
        f = e.charAt(r++), y = c, m = !1;
        var o,
            n = r - (t ? 2 : 3);

        do {
          if (--n < 0 || "\n" === (o = e.charAt(n))) {
            m = !0;
            break;
          }
        } while (" " === o || "\t" === o);

        for (var p = e.substring(r, i).split(u), l = 0; l < p.length; ++l) p[l] = p[l].replace(t ? a : s, "").trim();

        d = p.join("\n").trim();
      }

      function N(t) {
        var r = b(t),
            i = e.substring(t, r);
        return /^\s*\/{1,2}/.test(i);
      }

      function b(e) {
        for (var t = e; t < l && "\n" !== E(t);) t++;

        return t;
      }

      function T() {
        if (g.length > 0) return g.shift();
        if (v) return function () {
          var t = "'" === v ? n : o;
          t.lastIndex = r - 1;
          var i = t.exec(e);
          if (!i) throw _("string");
          return r = t.lastIndex, I(v), v = null, h(i[1]);
        }();
        var s, a, u, f, d;

        do {
          if (r === l) return null;

          for (s = !1; p.test(u = E(r));) if ("\n" === u && ++c, ++r === l) return null;

          if ("/" === E(r)) {
            if (++r === l) throw _("comment");
            if ("/" === E(r)) {
              if (t) {
                if (f = r, d = !1, N(r)) {
                  d = !0;

                  do {
                    if ((r = b(r)) === l) break;
                    r++;
                  } while (N(r));
                } else r = Math.min(l, b(r) + 1);

                d && O(f, r), c++, s = !0;
              } else {
                for (d = "/" === E(f = r + 1); "\n" !== E(++r);) if (r === l) return null;

                ++r, d && O(f, r - 1), ++c, s = !0;
              }
            } else {
              if ("*" !== (u = E(r))) return "/";
              f = r + 1, d = t || "*" === E(f);

              do {
                if ("\n" === u && ++c, ++r === l) throw _("comment");
                a = u, u = E(r);
              } while ("*" !== a || "/" !== u);

              ++r, d && O(f, r - 2), s = !0;
            }
          }
        } while (s);

        var y = r;
        if (i.lastIndex = 0, !i.test(E(y++))) for (; y < l && !i.test(E(y));) ++y;
        var m = e.substring(r, r = y);
        return '"' !== m && "'" !== m || (v = m), m;
      }

      function I(e) {
        g.push(e);
      }

      function R() {
        if (!g.length) {
          var e = T();
          if (null === e) return null;
          I(e);
        }

        return g[0];
      }

      return Object.defineProperty({
        next: T,
        peek: R,
        push: I,
        skip: function (e, t) {
          var r = R();
          if (r === e) return T(), !0;
          if (!t) throw _("token '" + r + "', '" + e + "' expected");
          return !1;
        },
        cmnt: function (e) {
          var r = null;
          return void 0 === e ? y === c - 1 && (t || "*" === f || m) && (r = d) : (y < e && R(), y !== e || m || !t && "/" !== f || (r = d)), r;
        }
      }, "line", {
        get: function () {
          return c;
        }
      });
    }

    f.unescape = h;
  }, function (e, t, r) {
    "use strict";

    e.exports = o;
    var i = r(2);

    function o(e, t, r) {
      if ("function" != typeof e) throw TypeError("rpcImpl must be a function");
      i.EventEmitter.call(this), this.rpcImpl = e, this.requestDelimited = Boolean(t), this.responseDelimited = Boolean(r);
    }

    (o.prototype = Object.create(i.EventEmitter.prototype)).constructor = o, o.prototype.rpcCall = function e(t, r, o, n, s) {
      if (!n) throw TypeError("request must be specified");
      var a = this;
      if (!s) return i.asPromise(e, a, t, r, o, n);
      if (a.rpcImpl) try {
        return a.rpcImpl(t, r[a.requestDelimited ? "encodeDelimited" : "encode"](n).finish(), function (e, r) {
          if (e) return a.emit("error", e, t), s(e);

          if (null !== r) {
            if (!(r instanceof o)) try {
              r = o[a.responseDelimited ? "decodeDelimited" : "decode"](r);
            } catch (e) {
              return a.emit("error", e, t), s(e);
            }
            return a.emit("data", r, t), s(null, r);
          }

          a.end(!0);
        });
      } catch (e) {
        return a.emit("error", e, t), void setTimeout(function () {
          s(e);
        }, 0);
      } else setTimeout(function () {
        s(Error("already ended"));
      }, 0);
    }, o.prototype.end = function (e) {
      return this.rpcImpl && (e || this.rpcImpl(null, null, null), this.rpcImpl = null, this.emit("end").off()), this;
    };
  }, function (e, t, r) {
    "use strict";

    e.exports = n;
    var i,
        o = /\/|\./;

    function n(e, t) {
      o.test(e) || (e = "google/protobuf/" + e + ".proto", t = {
        nested: {
          google: {
            nested: {
              protobuf: {
                nested: t
              }
            }
          }
        }
      }), n[e] = t;
    }

    n("any", {
      Any: {
        fields: {
          type_url: {
            type: "string",
            id: 1
          },
          value: {
            type: "bytes",
            id: 2
          }
        }
      }
    }), n("duration", {
      Duration: i = {
        fields: {
          seconds: {
            type: "int64",
            id: 1
          },
          nanos: {
            type: "int32",
            id: 2
          }
        }
      }
    }), n("timestamp", {
      Timestamp: i
    }), n("empty", {
      Empty: {
        fields: {}
      }
    }), n("struct", {
      Struct: {
        fields: {
          fields: {
            keyType: "string",
            type: "Value",
            id: 1
          }
        }
      },
      Value: {
        oneofs: {
          kind: {
            oneof: ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]
          }
        },
        fields: {
          nullValue: {
            type: "NullValue",
            id: 1
          },
          numberValue: {
            type: "double",
            id: 2
          },
          stringValue: {
            type: "string",
            id: 3
          },
          boolValue: {
            type: "bool",
            id: 4
          },
          structValue: {
            type: "Struct",
            id: 5
          },
          listValue: {
            type: "ListValue",
            id: 6
          }
        }
      },
      NullValue: {
        values: {
          NULL_VALUE: 0
        }
      },
      ListValue: {
        fields: {
          values: {
            rule: "repeated",
            type: "Value",
            id: 1
          }
        }
      }
    }), n("wrappers", {
      DoubleValue: {
        fields: {
          value: {
            type: "double",
            id: 1
          }
        }
      },
      FloatValue: {
        fields: {
          value: {
            type: "float",
            id: 1
          }
        }
      },
      Int64Value: {
        fields: {
          value: {
            type: "int64",
            id: 1
          }
        }
      },
      UInt64Value: {
        fields: {
          value: {
            type: "uint64",
            id: 1
          }
        }
      },
      Int32Value: {
        fields: {
          value: {
            type: "int32",
            id: 1
          }
        }
      },
      UInt32Value: {
        fields: {
          value: {
            type: "uint32",
            id: 1
          }
        }
      },
      BoolValue: {
        fields: {
          value: {
            type: "bool",
            id: 1
          }
        }
      },
      StringValue: {
        fields: {
          value: {
            type: "string",
            id: 1
          }
        }
      },
      BytesValue: {
        fields: {
          value: {
            type: "bytes",
            id: 1
          }
        }
      }
    }), n("field_mask", {
      FieldMask: {
        fields: {
          paths: {
            rule: "repeated",
            type: "string",
            id: 1
          }
        }
      }
    }), n.get = function (e) {
      return n[e] || null;
    };
  }, function (e, t, r) {
    "use strict";

    e.exports = a;
    var i,
        o,
        n = r(2);

    function s(e, t) {
      return RangeError("index out of range: " + e.pos + " + " + (t || 1) + " > " + e.len);
    }

    function a(e) {
      this.buf = e, this.pos = 0, this.len = e.length;
    }

    var u,
        p = "undefined" != typeof Uint8Array ? function (e) {
      if (e instanceof Uint8Array || Array.isArray(e)) return new a(e);
      if ("undefined" != typeof ArrayBuffer && e instanceof ArrayBuffer) return new a(new Uint8Array(e));
      throw Error("illegal buffer");
    } : function (e) {
      if (Array.isArray(e)) return new a(e);
      throw Error("illegal buffer");
    };

    function l() {
      var e = new i(0, 0),
          t = 0;

      if (!(this.len - this.pos > 4)) {
        for (; t < 3; ++t) {
          if (this.pos >= this.len) throw s(this);
          if (e.lo = (e.lo | (127 & this.buf[this.pos]) << 7 * t) >>> 0, this.buf[this.pos++] < 128) return e;
        }

        return e.lo = (e.lo | (127 & this.buf[this.pos++]) << 7 * t) >>> 0, e;
      }

      for (; t < 4; ++t) if (e.lo = (e.lo | (127 & this.buf[this.pos]) << 7 * t) >>> 0, this.buf[this.pos++] < 128) return e;

      if (e.lo = (e.lo | (127 & this.buf[this.pos]) << 28) >>> 0, e.hi = (e.hi | (127 & this.buf[this.pos]) >> 4) >>> 0, this.buf[this.pos++] < 128) return e;

      if (t = 0, this.len - this.pos > 4) {
        for (; t < 5; ++t) if (e.hi = (e.hi | (127 & this.buf[this.pos]) << 7 * t + 3) >>> 0, this.buf[this.pos++] < 128) return e;
      } else for (; t < 5; ++t) {
        if (this.pos >= this.len) throw s(this);
        if (e.hi = (e.hi | (127 & this.buf[this.pos]) << 7 * t + 3) >>> 0, this.buf[this.pos++] < 128) return e;
      }

      throw Error("invalid varint encoding");
    }

    function c(e, t) {
      return (e[t - 4] | e[t - 3] << 8 | e[t - 2] << 16 | e[t - 1] << 24) >>> 0;
    }

    function h() {
      if (this.pos + 8 > this.len) throw s(this, 8);
      return new i(c(this.buf, this.pos += 4), c(this.buf, this.pos += 4));
    }

    a.create = n.Buffer ? function (e) {
      return (a.create = function (e) {
        return n.Buffer.isBuffer(e) ? new (void 0)(e) : p(e);
      })(e);
    } : p, a.prototype._slice = n.Array.prototype.subarray || n.Array.prototype.slice, a.prototype.uint32 = (u = 4294967295, function () {
      if (u = (127 & this.buf[this.pos]) >>> 0, this.buf[this.pos++] < 128) return u;
      if (u = (u | (127 & this.buf[this.pos]) << 7) >>> 0, this.buf[this.pos++] < 128) return u;
      if (u = (u | (127 & this.buf[this.pos]) << 14) >>> 0, this.buf[this.pos++] < 128) return u;
      if (u = (u | (127 & this.buf[this.pos]) << 21) >>> 0, this.buf[this.pos++] < 128) return u;
      if (u = (u | (15 & this.buf[this.pos]) << 28) >>> 0, this.buf[this.pos++] < 128) return u;
      if ((this.pos += 5) > this.len) throw this.pos = this.len, s(this, 10);
      return u;
    }), a.prototype.int32 = function () {
      return 0 | this.uint32();
    }, a.prototype.sint32 = function () {
      var e = this.uint32();
      return e >>> 1 ^ -(1 & e) | 0;
    }, a.prototype.bool = function () {
      return 0 !== this.uint32();
    }, a.prototype.fixed32 = function () {
      if (this.pos + 4 > this.len) throw s(this, 4);
      return c(this.buf, this.pos += 4);
    }, a.prototype.sfixed32 = function () {
      if (this.pos + 4 > this.len) throw s(this, 4);
      return 0 | c(this.buf, this.pos += 4);
    }, a.prototype.float = function () {
      if (this.pos + 4 > this.len) throw s(this, 4);
      var e = n.float.readFloatLE(this.buf, this.pos);
      return this.pos += 4, e;
    }, a.prototype.double = function () {
      if (this.pos + 8 > this.len) throw s(this, 4);
      var e = n.float.readDoubleLE(this.buf, this.pos);
      return this.pos += 8, e;
    }, a.prototype.bytes = function () {
      var e = this.uint32(),
          t = this.pos,
          r = this.pos + e;
      if (r > this.len) throw s(this, e);
      return this.pos += e, Array.isArray(this.buf) ? this.buf.slice(t, r) : t === r ? new this.buf.constructor(0) : this._slice.call(this.buf, t, r);
    }, a.prototype.string = function () {
      var e = this.bytes();
      return o.read(e, 0, e.length);
    }, a.prototype.skip = function (e) {
      if ("number" == typeof e) {
        if (this.pos + e > this.len) throw s(this, e);
        this.pos += e;
      } else do {
        if (this.pos >= this.len) throw s(this);
      } while (128 & this.buf[this.pos++]);

      return this;
    }, a.prototype.skipType = function (e) {
      switch (e) {
        case 0:
          this.skip();
          break;

        case 1:
          this.skip(8);
          break;

        case 2:
          this.skip(this.uint32());
          break;

        case 3:
          for (;;) {
            if (4 == (e = 7 & this.uint32())) break;
            this.skipType(e);
          }

          break;

        case 5:
          this.skip(4);
          break;

        default:
          throw Error("invalid wire type " + e + " at offset " + this.pos);
      }

      return this;
    }, a._configure = function () {
      i = r(61), o = r(37);
      var e = n.Long ? "toLong" : "toNumber";
      n.merge(a.prototype, {
        int64: function () {
          return l.call(this)[e](!1);
        },
        uint64: function () {
          return l.call(this)[e](!0);
        },
        sint64: function () {
          return l.call(this).zzDecode()[e](!1);
        },
        fixed64: function () {
          return h.call(this)[e](!0);
        },
        sfixed64: function () {
          return h.call(this)[e](!1);
        }
      });
    };
  }, function (e, t, r) {
    "use strict";

    var i,
        o,
        n = r(1)(r(6));

    function s(e, t) {
      return e.name + ": " + t + (e.repeated && "array" !== t ? "[]" : e.map && "object" !== t ? "{k:" + e.keyType + "}" : "") + " expected";
    }

    function a(e, t, r, n) {
      var a = n.types;
      if (e.resolvedType) {
        if (e.resolvedType instanceof i) {
          if (Object.keys(e.resolvedType.values).indexOf(r) < 0) return s(e, "enum value");
        } else {
          var u = a[t].verify(r);
          if (u) return e.name + "." + u;
        }
      } else switch (e.type) {
        case "int32":
        case "uint32":
        case "sint32":
        case "fixed32":
        case "sfixed32":
          if (!o.isInteger(r)) return s(e, "integer");
          break;

        case "int64":
        case "uint64":
        case "sint64":
        case "fixed64":
        case "sfixed64":
          if (!(o.isInteger(r) || r && o.isInteger(r.low) && o.isInteger(r.high))) return s(e, "integer|Long");
          break;

        case "float":
        case "double":
          if ("number" != typeof r) return s(e, "number");
          break;

        case "bool":
          if ("boolean" != typeof r) return s(e, "boolean");
          break;

        case "string":
          if (!o.isString(r)) return s(e, "string");
          break;

        case "bytes":
          if (!(r && "number" == typeof r.length || o.isString(r))) return s(e, "buffer");
      }
    }

    function u(e, t) {
      switch (e.keyType) {
        case "int32":
        case "uint32":
        case "sint32":
        case "fixed32":
        case "sfixed32":
          if (!o.key32Re.test(t)) return s(e, "integer key");
          break;

        case "int64":
        case "uint64":
        case "sint64":
        case "fixed64":
        case "sfixed64":
          if (!o.key64Re.test(t)) return s(e, "integer|Long key");
          break;

        case "bool":
          if (!o.key2Re.test(t)) return s(e, "boolean key");
      }
    }

    function p(e) {
      return function (t) {
        return function (r) {
          var i;
          if ("object" !== (0, n.default)(r) || null === r) return "object expected";
          var p,
              l = {};
          e.oneofsArray.length && (p = {});

          for (var c = 0; c < e.fieldsArray.length; ++c) {
            var h,
                f = e._fieldsArray[c].resolve(),
                d = r[f.name];

            if (!f.optional || null != d && r.hasOwnProperty(f.name)) if (f.map) {
              if (!o.isObject(d)) return s(f, "object");
              var y = Object.keys(d);

              for (h = 0; h < y.length; ++h) {
                if (i = u(f, y[h])) return i;
                if (i = a(f, c, d[y[h]], t)) return i;
              }
            } else if (f.repeated) {
              if (!Array.isArray(d)) return s(f, "array");

              for (h = 0; h < d.length; ++h) if (i = a(f, c, d[h], t)) return i;
            } else {
              if (f.partOf) {
                var m = f.partOf.name;
                if (1 === l[f.partOf.name] && 1 === p[m]) return f.partOf.name + ": multiple values";
                p[m] = 1;
              }

              if (i = a(f, c, d, t)) return i;
            }
          }
        };
      };
    }

    e.exports = p, p._configure = function () {
      i = r(10), o = r(2);
    };
  }, function (e, t, r) {
    "use strict";

    var i, o;

    function n(e) {
      return function (t) {
        var r = t.Writer,
            n = t.types,
            s = t.util;
        return function (t, a) {
          a = a || r.create();

          for (var u = e.fieldsArray.slice().sort(s.compareFieldsById), p = 0; p < u.length; p++) {
            var l = u[p],
                c = e._fieldsArray.indexOf(l),
                h = l.resolvedType instanceof i ? "uint32" : l.type,
                f = o.basic[h],
                d = t[l.name];

            if (l.resolvedType instanceof i && "string" == typeof d && (d = n[c].values[d]), l.map) {
              if (null != d && t.hasOwnProperty(l.name)) for (var y = Object.keys(d), m = 0; m < y.length; ++m) a.uint32((l.id << 3 | 2) >>> 0).fork().uint32(8 | o.mapKey[l.keyType])[l.keyType](y[m]), void 0 === f ? n[c].encode(d[y[m]], a.uint32(18).fork()).ldelim().ldelim() : a.uint32(16 | f)[h](d[y[m]]).ldelim();
            } else if (l.repeated) {
              if (d && d.length) if (l.packed && void 0 !== o.packed[h]) {
                a.uint32((l.id << 3 | 2) >>> 0).fork();

                for (var g = 0; g < d.length; g++) a[h](d[g]);

                a.ldelim();
              } else for (var v = 0; v < d.length; v++) void 0 === f ? l.resolvedType.group ? n[c].encode(d[v], a.uint32((l.id << 3 | 3) >>> 0)).uint32((l.id << 3 | 4) >>> 0) : n[c].encode(d[v], a.uint32((l.id << 3 | 2) >>> 0).fork()).ldelim() : a.uint32((l.id << 3 | f) >>> 0)[h](d[v]);
            } else (!l.optional || null != d && t.hasOwnProperty(l.name)) && (l.optional || null != d && t.hasOwnProperty(l.name) || console.warn("注意啦!!!很大概率会报错 类型:", t.$type ? t.$type.name : "不晓得", "没有设置对应的属性:", l.name, "检查是不是proto文件属性设置为了required"), void 0 === f ? l.resolvedType.group ? n[c].encode(d, a.uint32((l.id << 3 | 3) >>> 0)).uint32((l.id << 3 | 4) >>> 0) : n[c].encode(d, a.uint32((l.id << 3 | 2) >>> 0).fork()).ldelim() : a.uint32((l.id << 3 | f) >>> 0)[h](d));
          }

          return a;
        };
      };
    }

    e.exports = n, n._configure = function () {
      i = r(10), o = r(23);
    };
  }, function (e, t, r) {
    "use strict";

    var i,
        o,
        n,
        s = r(1)(r(6));

    function a(e) {
      return "missing required '" + e.name + "'";
    }

    function u(e) {
      return function (t) {
        var r = t.Reader,
            u = t.types,
            p = t.util;
        return function (t, l) {
          t instanceof r || (t = r.create(t));

          for (var c, h = void 0 === l ? t.len : t.pos + l, f = new this.ctor(); t.pos < h;) {
            var d = t.uint32();
            if (e.group && 4 == (7 & d)) break;

            for (var y = d >>> 3, m = 0, g = !1; m < e.fieldsArray.length; ++m) {
              var v = e._fieldsArray[m].resolve(),
                  _ = v.name,
                  E = v.resolvedType instanceof i ? "int32" : v.type;

              if (y == v.id) {
                if (g = !0, v.map) t.skip().pos++, f[_] === p.emptyObject && (f[_] = {}), c = t[v.keyType](), t.pos++, null != o.long[v.keyType] ? null == o.basic[E] ? f[_]["object" === (0, s.default)(c) ? p.longToHash(c) : c] = u[m].decode(t, t.uint32()) : f[_]["object" === (0, s.default)(c) ? p.longToHash(c) : c] = t[E]() : null == o.basic[E] ? f[_] = u[m].decode(t, t.uint32()) : f[_] = t[E]();else if (v.repeated) {
                  if (f[_] && f[_].length || (f[_] = []), null != o.packed[E] && 2 == (7 & d)) for (var O = t.uint32() + t.pos; t.pos < O;) f[_].push(t[E]());else null == o.basic[E] ? v.resolvedType.group ? f[_].push(u[m].decode(t)) : f[_].push(u[m].decode(t, t.uint32())) : f[_].push(t[E]());
                } else null == o.basic[E] ? v.resolvedType.group ? f[_] = u[m].decode(t) : f[_] = u[m].decode(t, t.uint32()) : f[_] = t[E]();
                break;
              }
            }

            g || (console.log("t", d), t.skipType(7 & d));
          }

          for (m = 0; m < e._fieldsArray.length; ++m) {
            var N = e._fieldsArray[m];
            if (N.required && !f.hasOwnProperty(N.name)) throw n.ProtocolError(a(N), {
              instance: f
            });
          }

          return f;
        };
      };
    }

    e.exports = u, u._configure = function () {
      i = r(10), o = r(23), n = r(2);
    };
  }, function (e, t, r) {
    "use strict";

    var i,
        o = t;
    o[".google.protobuf.Any"] = {
      fromObject: function (e) {
        if (e && e["@type"]) {
          var t = this.lookup(e["@type"]);

          if (t) {
            var r = "." === e["@type"].charAt(0) ? e["@type"].substr(1) : e["@type"];
            return this.create({
              type_url: "/" + r,
              value: t.encode(t.fromObject(e)).finish()
            });
          }
        }

        return this.fromObject(e);
      },
      toObject: function (e, t) {
        if (t && t.json && e.type_url && e.value) {
          var r = e.type_url.substring(e.type_url.lastIndexOf("/") + 1),
              o = this.lookup(r);
          o && (e = o.decode(e.value));
        }

        if (!(e instanceof this.ctor) && e instanceof i) {
          var n = e.$type.toObject(e, t);
          return n["@type"] = e.$type.fullName, n;
        }

        return this.toObject(e, t);
      }
    }, o._configure = function () {
      i = r(64);
    };
  }, function (e, t, r) {
    "use strict";

    var i,
        o,
        n = r(1)(r(6)),
        s = e.exports;

    function a(e, t, r, s) {
      var a = s.m,
          u = s.d,
          p = s.types,
          l = s.ksi,
          c = void 0 !== l;
      if (e.resolvedType) {
        if (e.resolvedType instanceof i) {
          for (var h = c ? u[r][l] : u[r], f = e.resolvedType.values, d = Object.keys(f), y = 0; y < d.length; y++) if (!(e.repeated && f[d[y]] === e.typeDefault || d[y] != h && f[d[y]] != h)) {
            c ? a[r][l] = f[d[y]] : a[r] = f[d[y]];
            break;
          }
        } else {
          if ("object" !== (0, n.default)(c ? u[r][l] : u[r])) throw TypeError(e.fullName + ": object expected");
          c ? a[r][l] = p[t].fromObject(u[r][l]) : a[r] = p[t].fromObject(u[r]);
        }
      } else {
        var m = !1;

        switch (e.type) {
          case "double":
          case "float":
            c ? a[r][l] = Number(u[r][l]) : a[r] = Number(u[r]);
            break;

          case "uint32":
          case "fixed32":
            c ? a[r][l] = u[r][l] >>> 0 : a[r] = u[r] >>> 0;
            break;

          case "int32":
          case "sint32":
          case "sfixed32":
            c ? a[r][l] = 0 | u[r][l] : a[r] = 0 | u[r];
            break;

          case "uint64":
            m = !0;

          case "int64":
          case "sint64":
          case "fixed64":
          case "sfixed64":
            o.Long ? c ? a[r][l] = o.Long.fromValue(u[r][l]).unsigned = m : a[r] = o.Long.fromValue(u[r]).unsigned = m : "string" == typeof (c ? u[r][l] : u[r]) ? c ? a[r][l] = parseInt(u[r][l], 10) : a[r] = parseInt(u[r], 10) : "number" == typeof (c ? u[r][l] : u[r]) ? c ? a[r][l] = u[r][l] : a[r] = u[r] : "object" === (0, n.default)(c ? u[r][l] : u[r]) && (c ? a[r][l] = new o.LongBits(u[r][l].low >>> 0, u[r][l].high >>> 0).toNumber(m) : a[r] = new o.LongBits(u[r].low >>> 0, u[r].high >>> 0).toNumber(m));
            break;

          case "bytes":
            "string" == typeof (c ? u[r][l] : u[r]) ? c ? o.base64.decode(u[r][l], a[r][l] = o.newBuffer(o.base64.length(u[r][l])), 0) : o.base64.decode(u[r], a[r] = o.newBuffer(o.base64.length(u[r])), 0) : (c ? u[r][l] : u[r]).length && (c ? a[r][l] = u[r][l] : a[r] = u[r]);
            break;

          case "string":
            c ? a[r][l] = String(u[r][l]) : a[r] = String(u[r]);
            break;

          case "bool":
            c ? a[r][l] = Boolean(u[r][l]) : a[r] = Boolean(u[r]);
        }
      }
    }

    function u(e, t, r, n) {
      var s = n.m,
          a = n.d,
          u = n.types,
          p = n.ksi,
          l = n.o,
          c = void 0 !== p;
      if (e.resolvedType) e.resolvedType instanceof i ? c ? a[r][p] = l.enums === String ? u[t].values[s[r][p]] : s[r][p] : a[r] = l.enums === String ? u[t].values[s[r]] : s[r] : c ? a[r][p] = u[t].toObject(s[r][p], l) : a[r] = u[t].toObject(s[r], l);else {
        var h = !1;

        switch (e.type) {
          case "double":
          case "float":
            c ? a[r][p] = l.json && !isFinite(s[r][p]) ? String(s[r][p]) : s[r][p] : a[r] = l.json && !isFinite(s[r]) ? String(s[r]) : s[r];
            break;

          case "uint64":
            h = !0;

          case "int64":
          case "sint64":
          case "fixed64":
          case "sfixed64":
            "number" == typeof s[r][p] ? c ? a[r][p] = l.longs === String ? String(s[r][p]) : s[r][p] : a[r] = l.longs === String ? String(s[r]) : s[r] : c ? a[r][p] = l.longs === String ? o.Long.prototype.toString.call(s[r][p]) : l.longs === Number ? new o.LongBits(s[r][p].low >>> 0, s[r][p].high >>> 0).toNumber(h) : s[r][p] : a[r] = l.longs === String ? o.Long.prototype.toString.call(s[r]) : l.longs === Number ? new o.LongBits(s[r].low >>> 0, s[r].high >>> 0).toNumber(h) : s[r];
            break;

          case "bytes":
            c ? a[r][p] = l.bytes === String ? o.base64.encode(s[r][p], 0, s[r][p].length) : l.bytes === Array ? Array.prototype.slice.call(s[r][p]) : s[r][p] : a[r] = l.bytes === String ? o.base64.encode(s[r], 0, s[r].length) : l.bytes === Array ? Array.prototype.slice.call(s[r]) : s[r];
            break;

          default:
            c ? a[r][p] = s[r][p] : a[r] = s[r];
        }
      }
    }

    s._configure = function () {
      i = r(10), o = r(2);
    }, s.fromObject = function (e) {
      var t = e.fieldsArray;
      return function (e) {
        return function (r) {
          if (r instanceof this.ctor) return r;
          if (!t.length) return new this.ctor();

          for (var s = new this.ctor(), u = 0; u < t.length; ++u) {
            var p,
                l = t[u].resolve(),
                c = l.name;

            if (l.map) {
              if (r[c]) {
                if ("object" !== (0, n.default)(r[c])) throw TypeError(l.fullName + ": object expected");
                s[c] = {};
              }

              var h = Object.keys(r[c]);

              for (p = 0; p < h.length; ++p) a(l, u, c, o.merge(o.copy(e), {
                m: s,
                d: r,
                ksi: h[p]
              }));
            } else if (l.repeated) {
              if (r[c]) {
                if (!Array.isArray(r[c])) throw TypeError(l.fullName + ": array expected");

                for (s[c] = [], p = 0; p < r[c].length; ++p) a(l, u, c, o.merge(o.copy(e), {
                  m: s,
                  d: r,
                  ksi: p
                }));
              }
            } else (l.resolvedType instanceof i || null != r[c]) && a(l, u, c, o.merge(o.copy(e), {
              m: s,
              d: r
            }));
          }

          return s;
        };
      };
    }, s.toObject = function (e) {
      var t = e.fieldsArray.slice().sort(o.compareFieldsById);
      return function (r) {
        return t.length ? function (n, s) {
          s = s || {};

          for (var a, p, l = {}, c = [], h = [], f = [], d = 0; d < t.length; ++d) t[d].partOf || (t[d].resolve().repeated ? c : t[d].map ? h : f).push(t[d]);

          if (c.length && (s.arrays || s.defaults)) for (d = 0; d < c.length; ++d) l[c[d].name] = [];
          if (h.length && (s.objects || s.defaults)) for (d = 0; d < h.length; ++d) l[h[d].name] = {};
          if (f.length && s.defaults) for (d = 0; d < f.length; ++d) if (p = (a = f[d]).name, a.resolvedType instanceof i) l[p] = s.enums = String ? a.resolvedType.valuesById[a.typeDefault] : a.typeDefault;else if (a.long) {
            if (o.Long) {
              var y = new o.Long(a.typeDefault.low, a.typeDefault.high, a.typeDefault.unsigned);
              l[p] = s.longs === String ? y.toString() : s.longs === Number ? y.toNumber() : y;
            } else l[p] = s.longs === String ? a.typeDefault.toString() : a.typeDefault.toNumber();
          } else a.bytes ? l[p] = s.bytes === String ? String.fromCharCode.apply(String, a.typeDefault) : Array.prototype.slice.call(a.typeDefault).join("*..*").split("*..*") : l[p] = a.typeDefault;
          var m = !1;

          for (d = 0; d < t.length; ++d) {
            p = (a = t[d]).name;

            var g,
                v,
                _ = e._fieldsArray.indexOf(a);

            if (a.map) {
              if (m || (m = !0), n[p] && (g = Object.keys(n[p]).length)) for (l[p] = {}, v = 0; v < g.length; ++v) u(a, _, p, o.merge(o.copy(r), {
                m: n,
                d: l,
                ksi: g[v],
                o: s
              }));
            } else if (a.repeated) {
              if (n[p] && n[p].length) for (l[p] = [], v = 0; v < n[p].length; ++v) u(a, _, p, o.merge(o.copy(r), {
                m: n,
                d: l,
                ksi: v,
                o: s
              }));
            } else null != n[p] && n.hasOwnProperty(p) && u(a, _, p, o.merge(o.copy(r), {
              m: n,
              d: l,
              o: s
            })), a.partOf && s.oneofs && (l[a.partOf.name] = p);
          }

          return l;
        } : function () {
          return {};
        };
      };
    };
  },,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, function (e, t, r) {
    "use strict";

    var i = r(1);
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.default = void 0;
    var o,
        n = i(r(52)),
        s = i(r(8)),
        a = i(r(60)),
        u = i(r(153)),
        p = i(r(7)),
        l = i(r(160)),
        c = (0, p.default)(),
        h = (0, a.default)(),
        f = n.default.connection.prototype.root = u.default.Root.fromJSON(h);
    n.default.connection.prototype.getParams({
      root: f,
      utils: l.default
    });

    var d = function (e, t, r) {
      var i = {
        data: new Uint8Array(e).buffer
      };
      if (r) return i;

      try {
        o.send(i);
      } catch (e) {
        t.onError({
          type: c.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR,
          msg: e
        });
      }
    },
        y = uni || tt || qq || swan;

    function m(e) {
      return y.connectSocket({
        url: e.url,
        header: {
          "content-type": "application/json"
        },
        success: function (e) {
          console.log("socket连接成功");
        },
        fail: function (e) {
          e.errMsg.indexOf("suspend");
        }
      });
    }

    n.default.connection.prototype._base64transform = d, n.default.connection.prototype._getSock = m, n.default.connection.prototype._login = function (e, t) {
      if (e) try {
        if (o = m(t), n.default.connection.prototype.sock = o, o.onOpen(function () {
          console.log("onOpen"), t.autoReconnectInterval = 0, t.times = 1, t.autoReconnectNumTotal = 0;
          var r = [],
              i = new Date().valueOf(),
              o = f.lookup("easemob.pb.Provision"),
              n = o.decode(r);
          t.context.jid.clientResource = t.deviceId + "_" + i.toString(), n.compressType = t.compressType, n.encryptType = t.encryptType, n.osType = t.osType, n.version = t.version, n.deviceName = t.deviceId, n.resource = t.deviceId + "_" + i.toString(), n.deviceUuid = i.toString(), n.auth = "$t$" + e.access_token, n = o.encode(n).finish();
          var s = f.lookup("easemob.pb.MSync"),
              a = s.decode(r);
          if (a.version = t.version, a.guid = t.context.jid, a.auth = "$t$" + e.access_token, a.command = 3, a.deviceId = t.deviceId, a.encryptType = t.encryptType, a.payload = n, a = s.encode(a).finish(), d(a), t.logOut = !1, t.offLineSendConnecting = !1, t.unSendMsgArr.length > 0) for (var u in t.unSendMsgArr) {
            var p = t.unSendMsgArr[u];
            t.sendMSync(p), delete t.unSendMsgArr[u];
          }
          t.onOpened();
        }), o.onClose(function (e) {
          if (console.log("onClose", e), !t.logOut && t.autoReconnectNumTotal < t.autoReconnectNumMax && (t.autoReconnectNumTotal <= t.xmppHosts.length && t.isHttpDNS || !t.isHttpDNS)) {
            t.reconnect();
            var r = {
              type: c.WEBIM_CONNCTION_DISCONNECTED
            };
            t.onError(r);
          } else if (t.logOut) t.clear(), t.onClosed();else {
            r = {
              type: c.WEBIM_CONNCTION_DISCONNECTED
            };
            t.onError(r), t.onClosed();
          }
        }), o.onMessage(function (e) {
          var r = f.lookup("easemob.pb.MSync").decode(e.data);

          switch (r.command) {
            case 0:
              var i = f.lookup("easemob.pb.CommSyncDL");
              i = i.decode(r.payload);
              var o = new s.default(i.serverId.low, i.serverId.high, i.serverId.unsigned).toString(),
                  n = new s.default(i.metaId.low, i.metaId.high, i.metaId.unsigned).toString();
              if (0 !== i.metas.length) t._metapayload(i.metas, i.status, t), t._lastsession(i.nextKey, i.queue, t);else if (i.isLast) {
                var a = l.default.checkArray(t._queues, i.queue);
                !1 !== a && t._queues.splice(a, 1), t._queues.length > 0 && (t._backqueue(t._queues[0], t), this.qTimer && clearTimeout(this.qTimer));
              } else if (i.status && 0 === i.status.errorCode) {
                if (t._msgHash[n]) {
                  try {
                    t._msgHash[n].success instanceof Function && t._msgHash[n].success(n, o);
                  } catch (e) {
                    t.onError({
                      type: c.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,
                      data: e
                    });
                  }

                  delete t._msgHash[n];
                }

                t.onReceivedMessage({
                  id: n,
                  mid: o
                }), t.heartBeat(t);
              } else if (i.status && 15 === i.status.errorCode) t.onMutedMessage({
                mid: o
              });else if (i.status && 1 === i.status.errorCode) {
                var u = "";

                switch (i.status.reason) {
                  case "blocked":
                    u = c.PERMISSION_DENIED;
                    break;

                  case "group not found":
                    u = c.GROUP_NOT_EXIST;
                    break;

                  case "not in group or chatroom":
                    u = c.GROUP_NOT_JOINED;
                    break;

                  case "exceed recall time limit":
                    u = c.MESSAGE_RECALL_TIME_LIMIT;
                    break;

                  case "message recall disabled":
                    u = c.SERVICE_NOT_ENABLED;
                    break;

                  case "not in group or chatroom white list":
                    u = c.SERVICE_NOT_ALLOW_MESSAGING;
                    break;

                  default:
                    u = c.SERVER_UNKNOWN_ERROR;
                }

                t.onError({
                  type: u,
                  reason: i.status.reason ? i.status.reason : "",
                  data: {
                    id: n,
                    mid: o
                  }
                });
              } else if (i.status && 7 === i.status.errorCode && "sensitive words" === i.status.reason) t.onError({
                type: c.MESSAGE_INCLUDE_ILLEGAL_CONTENT,
                data: {
                  id: n,
                  mid: o
                }
              });else {
                if (t._msgHash[n]) {
                  try {
                    t._msgHash[n].fail instanceof Function && t._msgHash[n].fail(n, o);
                  } catch (e) {
                    t.onError({
                      type: c.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,
                      data: e
                    });
                  }

                  delete t._msgHash[n];
                }

                t.onError({
                  type: c.WEBIM_LOAD_MSG_ERROR,
                  data: {
                    errorCode: i.status && i.status.errorCode,
                    reason: i.status && i.status.reason
                  }
                });
              }
              break;

            case 1:
              var p = f.lookup("easemob.pb.CommUnreadDL");
              if (p = p.decode(r.payload), t.isDebug && console.log("下行CommUnreadDLMessage：", p), 0 === p.unread.length) ;else for (var h = 0; h < p.unread.length; h++) t._backqueue(p.unread[h].queue, t);

              t._rebuild();

              break;

            case 2:
              var d = f.lookup("easemob.pb.CommNotice").decode(r.payload);
              if (t.isDebug && console.log("下行noticeMessage：", d), !1 !== l.default.checkArray(t._queues, d.queue)) return;
              t._queues.push(d.queue), this.qTimer && clearTimeout(this.qTimer), this.qTimer = setTimeout(function () {
                var e = d.queue;
                !1 !== l.default.checkArray(t._queues, e) && (t._backqueue(e, t), t.isDebug && console.log("上行q: ", e, t._queues, d.queue));
              }, 2e4), 1 == t._queues.length && t._backqueue(d.queue, t);
              break;

            case 3:
              t._receiveProvision(r, t), t.isDebug && console.log("下行Provision：", r);
          }
        }), "" == (e.access_token || "")) return void t.onError({
          type: c.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,
          data: e
        });
        t.context.accessToken = e.access_token;
      } catch (e) {}
    }, n.default.version = "_version";
    var g = n.default;
    t.default = g;
  }, function (e, t, r) {
    "use strict";

    e.exports = function () {
      var e = {};

      function t(t, r, i) {
        return "function" == typeof r ? (i = r, r = new e.Root()) : r || (r = new e.Root()), r.load(t, i);
      }

      function i(t, r) {
        return r || (r = new e.Root()), r.loadSync(t);
      }

      function o(t, r, i) {
        return "function" == typeof r ? (i = r, r = new e.Root()) : r || (r = new e.Root()), r.parseFromPbString(t, i);
      }

      function n() {
        e.converter._configure(), e.decoder._configure(), e.encoder._configure(), e.Field._configure(), e.MapField._configure(), e.Message._configure(), e.Namespace._configure(), e.Method._configure(), e.ReflectionObject._configure(), e.OneOf._configure(), e.parse._configure(), e.Reader._configure(), e.Root._configure(), e.Service._configure(), e.verifier._configure(), e.Type._configure(), e.types._configure(), e.wrappers._configure(), e.Writer._configure();
      }

      if (e.build = "minimal", e.Writer = r(89), e.encoder = r(98), e.Reader = r(96), e.util = r(2), e.rpc = r(94), e.roots = r(90), e.verifier = r(97), e.tokenize = r(93), e.parse = r(92), e.common = r(95), e.ReflectionObject = r(22), e.Namespace = r(31), e.Root = r(38), e.Enum = r(10), e.Type = r(21), e.Field = r(15), e.OneOf = r(32), e.MapField = r(62), e.Service = r(39), e.Method = r(63), e.converter = r(101), e.decoder = r(99), e.Message = r(64), e.wrappers = r(100), e.types = r(23), e.util = r(2), e.configure = n, e.load = t, e.loadSync = i, e.parseFromPbString = o, n(), arguments && arguments.length) for (var s = 0; s < arguments.length; s++) {
        var a = arguments[s];
        if (a.hasOwnProperty("exports")) return void (a.exports = e);
      }
      return e;
    }();
  }, function (e, t, r) {
    "use strict";

    e.exports = o;
    var i = null;

    try {
      i = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports;
    } catch (e) {}

    function o(e, t, r) {
      this.low = 0 | e, this.high = 0 | t, this.unsigned = !!r;
    }

    function n(e) {
      return !0 === (e && e.__isLong__);
    }

    o.prototype.__isLong__, Object.defineProperty(o.prototype, "__isLong__", {
      value: !0
    }), o.isLong = n;
    var s = {},
        a = {};

    function u(e, t) {
      var r, i, o;
      return t ? (o = 0 <= (e >>>= 0) && e < 256) && (i = a[e]) ? i : (r = l(e, (0 | e) < 0 ? -1 : 0, !0), o && (a[e] = r), r) : (o = -128 <= (e |= 0) && e < 128) && (i = s[e]) ? i : (r = l(e, e < 0 ? -1 : 0, !1), o && (s[e] = r), r);
    }

    function p(e, t) {
      if (isNaN(e)) return t ? _ : v;

      if (t) {
        if (e < 0) return _;
        if (e >= y) return T;
      } else {
        if (e <= -m) return I;
        if (e + 1 >= m) return b;
      }

      return e < 0 ? p(-e, t).neg() : l(e % d | 0, e / d | 0, t);
    }

    function l(e, t, r) {
      return new o(e, t, r);
    }

    o.fromInt = u, o.fromNumber = p, o.fromBits = l;
    var c = Math.pow;

    function h(e, t, r) {
      if (0 === e.length) throw Error("empty string");
      if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e) return v;
      if ("number" == typeof t ? (r = t, t = !1) : t = !!t, (r = r || 10) < 2 || 36 < r) throw RangeError("radix");
      var i;
      if ((i = e.indexOf("-")) > 0) throw Error("interior hyphen");
      if (0 === i) return h(e.substring(1), t, r).neg();

      for (var o = p(c(r, 8)), n = v, s = 0; s < e.length; s += 8) {
        var a = Math.min(8, e.length - s),
            u = parseInt(e.substring(s, s + a), r);

        if (a < 8) {
          var l = p(c(r, a));
          n = n.mul(l).add(p(u));
        } else n = (n = n.mul(o)).add(p(u));
      }

      return n.unsigned = t, n;
    }

    function f(e, t) {
      return "number" == typeof e ? p(e, t) : "string" == typeof e ? h(e, t) : l(e.low, e.high, "boolean" == typeof t ? t : e.unsigned);
    }

    o.fromString = h, o.fromValue = f;
    var d = 4294967296,
        y = d * d,
        m = y / 2,
        g = u(1 << 24),
        v = u(0);
    o.ZERO = v;

    var _ = u(0, !0);

    o.UZERO = _;
    var E = u(1);
    o.ONE = E;
    var O = u(1, !0);
    o.UONE = O;
    var N = u(-1);
    o.NEG_ONE = N;
    var b = l(-1, 2147483647, !1);
    o.MAX_VALUE = b;
    var T = l(-1, -1, !0);
    o.MAX_UNSIGNED_VALUE = T;
    var I = l(0, -2147483648, !1);
    o.MIN_VALUE = I;
    var R = o.prototype;
    R.toInt = function () {
      return this.unsigned ? this.low >>> 0 : this.low;
    }, R.toNumber = function () {
      return this.unsigned ? (this.high >>> 0) * d + (this.low >>> 0) : this.high * d + (this.low >>> 0);
    }, R.toString = function (e) {
      if ((e = e || 10) < 2 || 36 < e) throw RangeError("radix");
      if (this.isZero()) return "0";

      if (this.isNegative()) {
        if (this.eq(I)) {
          var t = p(e),
              r = this.div(t),
              i = r.mul(t).sub(this);
          return r.toString(e) + i.toInt().toString(e);
        }

        return "-" + this.neg().toString(e);
      }

      for (var o = p(c(e, 6), this.unsigned), n = this, s = "";;) {
        var a = n.div(o),
            u = (n.sub(a.mul(o)).toInt() >>> 0).toString(e);
        if ((n = a).isZero()) return u + s;

        for (; u.length < 6;) u = "0" + u;

        s = "" + u + s;
      }
    }, R.getHighBits = function () {
      return this.high;
    }, R.getHighBitsUnsigned = function () {
      return this.high >>> 0;
    }, R.getLowBits = function () {
      return this.low;
    }, R.getLowBitsUnsigned = function () {
      return this.low >>> 0;
    }, R.getNumBitsAbs = function () {
      if (this.isNegative()) return this.eq(I) ? 64 : this.neg().getNumBitsAbs();

      for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--);

      return 0 != this.high ? t + 33 : t + 1;
    }, R.isZero = function () {
      return 0 === this.high && 0 === this.low;
    }, R.eqz = R.isZero, R.isNegative = function () {
      return !this.unsigned && this.high < 0;
    }, R.isPositive = function () {
      return this.unsigned || this.high >= 0;
    }, R.isOdd = function () {
      return 1 == (1 & this.low);
    }, R.isEven = function () {
      return 0 == (1 & this.low);
    }, R.equals = function (e) {
      return n(e) || (e = f(e)), (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low;
    }, R.eq = R.equals, R.notEquals = function (e) {
      return !this.eq(e);
    }, R.neq = R.notEquals, R.ne = R.notEquals, R.lessThan = function (e) {
      return this.comp(e) < 0;
    }, R.lt = R.lessThan, R.lessThanOrEqual = function (e) {
      return this.comp(e) <= 0;
    }, R.lte = R.lessThanOrEqual, R.le = R.lessThanOrEqual, R.greaterThan = function (e) {
      return this.comp(e) > 0;
    }, R.gt = R.greaterThan, R.greaterThanOrEqual = function (e) {
      return this.comp(e) >= 0;
    }, R.gte = R.greaterThanOrEqual, R.ge = R.greaterThanOrEqual, R.compare = function (e) {
      if (n(e) || (e = f(e)), this.eq(e)) return 0;
      var t = this.isNegative(),
          r = e.isNegative();
      return t && !r ? -1 : !t && r ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high === this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1;
    }, R.comp = R.compare, R.negate = function () {
      return !this.unsigned && this.eq(I) ? I : this.not().add(E);
    }, R.neg = R.negate, R.add = function (e) {
      n(e) || (e = f(e));
      var t = this.high >>> 16,
          r = 65535 & this.high,
          i = this.low >>> 16,
          o = 65535 & this.low,
          s = e.high >>> 16,
          a = 65535 & e.high,
          u = e.low >>> 16,
          p = 0,
          c = 0,
          h = 0,
          d = 0;
      return h += (d += o + (65535 & e.low)) >>> 16, c += (h += i + u) >>> 16, p += (c += r + a) >>> 16, p += t + s, l((h &= 65535) << 16 | (d &= 65535), (p &= 65535) << 16 | (c &= 65535), this.unsigned);
    }, R.subtract = function (e) {
      return n(e) || (e = f(e)), this.add(e.neg());
    }, R.sub = R.subtract, R.multiply = function (e) {
      if (this.isZero()) return v;
      if (n(e) || (e = f(e)), i) return l(i.mul(this.low, this.high, e.low, e.high), i.get_high(), this.unsigned);
      if (e.isZero()) return v;
      if (this.eq(I)) return e.isOdd() ? I : v;
      if (e.eq(I)) return this.isOdd() ? I : v;
      if (this.isNegative()) return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
      if (e.isNegative()) return this.mul(e.neg()).neg();
      if (this.lt(g) && e.lt(g)) return p(this.toNumber() * e.toNumber(), this.unsigned);
      var t = this.high >>> 16,
          r = 65535 & this.high,
          o = this.low >>> 16,
          s = 65535 & this.low,
          a = e.high >>> 16,
          u = 65535 & e.high,
          c = e.low >>> 16,
          h = 65535 & e.low,
          d = 0,
          y = 0,
          m = 0,
          _ = 0;
      return m += (_ += s * h) >>> 16, y += (m += o * h) >>> 16, m &= 65535, y += (m += s * c) >>> 16, d += (y += r * h) >>> 16, y &= 65535, d += (y += o * c) >>> 16, y &= 65535, d += (y += s * u) >>> 16, d += t * h + r * c + o * u + s * a, l((m &= 65535) << 16 | (_ &= 65535), (d &= 65535) << 16 | (y &= 65535), this.unsigned);
    }, R.mul = R.multiply, R.divide = function (e) {
      if (n(e) || (e = f(e)), e.isZero()) throw Error("division by zero");
      var t, r, o;
      if (i) return this.unsigned || -2147483648 !== this.high || -1 !== e.low || -1 !== e.high ? l((this.unsigned ? i.div_u : i.div_s)(this.low, this.high, e.low, e.high), i.get_high(), this.unsigned) : this;
      if (this.isZero()) return this.unsigned ? _ : v;

      if (this.unsigned) {
        if (e.unsigned || (e = e.toUnsigned()), e.gt(this)) return _;
        if (e.gt(this.shru(1))) return O;
        o = _;
      } else {
        if (this.eq(I)) return e.eq(E) || e.eq(N) ? I : e.eq(I) ? E : (t = this.shr(1).div(e).shl(1)).eq(v) ? e.isNegative() ? E : N : (r = this.sub(e.mul(t)), o = t.add(r.div(e)));
        if (e.eq(I)) return this.unsigned ? _ : v;
        if (this.isNegative()) return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
        if (e.isNegative()) return this.div(e.neg()).neg();
        o = v;
      }

      for (r = this; r.gte(e);) {
        t = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));

        for (var s = Math.ceil(Math.log(t) / Math.LN2), a = s <= 48 ? 1 : c(2, s - 48), u = p(t), h = u.mul(e); h.isNegative() || h.gt(r);) h = (u = p(t -= a, this.unsigned)).mul(e);

        u.isZero() && (u = E), o = o.add(u), r = r.sub(h);
      }

      return o;
    }, R.div = R.divide, R.modulo = function (e) {
      return n(e) || (e = f(e)), i ? l((this.unsigned ? i.rem_u : i.rem_s)(this.low, this.high, e.low, e.high), i.get_high(), this.unsigned) : this.sub(this.div(e).mul(e));
    }, R.mod = R.modulo, R.rem = R.modulo, R.not = function () {
      return l(~this.low, ~this.high, this.unsigned);
    }, R.and = function (e) {
      return n(e) || (e = f(e)), l(this.low & e.low, this.high & e.high, this.unsigned);
    }, R.or = function (e) {
      return n(e) || (e = f(e)), l(this.low | e.low, this.high | e.high, this.unsigned);
    }, R.xor = function (e) {
      return n(e) || (e = f(e)), l(this.low ^ e.low, this.high ^ e.high, this.unsigned);
    }, R.shiftLeft = function (e) {
      return n(e) && (e = e.toInt()), 0 == (e &= 63) ? this : e < 32 ? l(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : l(0, this.low << e - 32, this.unsigned);
    }, R.shl = R.shiftLeft, R.shiftRight = function (e) {
      return n(e) && (e = e.toInt()), 0 == (e &= 63) ? this : e < 32 ? l(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : l(this.high >> e - 32, this.high >= 0 ? 0 : -1, this.unsigned);
    }, R.shr = R.shiftRight, R.shiftRightUnsigned = function (e) {
      if (n(e) && (e = e.toInt()), 0 === (e &= 63)) return this;
      var t = this.high;
      return e < 32 ? l(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : l(32 === e ? t : t >>> e - 32, 0, this.unsigned);
    }, R.shru = R.shiftRightUnsigned, R.shr_u = R.shiftRightUnsigned, R.toSigned = function () {
      return this.unsigned ? l(this.low, this.high, !1) : this;
    }, R.toUnsigned = function () {
      return this.unsigned ? this : l(this.low, this.high, !0);
    }, R.toBytes = function (e) {
      return e ? this.toBytesLE() : this.toBytesBE();
    }, R.toBytesLE = function () {
      var e = this.high,
          t = this.low;
      return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24];
    }, R.toBytesBE = function () {
      var e = this.high,
          t = this.low;
      return [e >>> 24, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24, t >>> 16 & 255, t >>> 8 & 255, 255 & t];
    }, o.fromBytes = function (e, t, r) {
      return r ? o.fromBytesLE(e, t) : o.fromBytesBE(e, t);
    }, o.fromBytesLE = function (e, t) {
      return new o(e[0] | e[1] << 8 | e[2] << 16 | e[3] << 24, e[4] | e[5] << 8 | e[6] << 16 | e[7] << 24, t);
    }, o.fromBytesBE = function (e, t) {
      return new o(e[4] << 24 | e[5] << 16 | e[6] << 8 | e[7], e[0] << 24 | e[1] << 16 | e[2] << 8 | e[3], t);
    };
  }, function (e, t, r) {
    "use strict";

    e.exports = function (e, t, r) {
      var i = r || 8192,
          o = i >>> 1,
          n = null,
          s = i;
      return function (r) {
        if (r < 1 || r > o) return e(r);
        s + r > i && (n = e(i), s = 0);
        var a = t.call(n, s, s += r);
        return 7 & s && (s = 1 + (7 | s)), a;
      };
    };
  }, function (e, t, r) {
    "use strict";

    function i(e) {
      return "undefined" != typeof Float32Array ? function () {
        var t = new Float32Array([-0]),
            r = new Uint8Array(t.buffer),
            i = 128 === r[3];

        function o(e, i, o) {
          t[0] = e, i[o] = r[0], i[o + 1] = r[1], i[o + 2] = r[2], i[o + 3] = r[3];
        }

        function n(e, i, o) {
          t[0] = e, i[o] = r[3], i[o + 1] = r[2], i[o + 2] = r[1], i[o + 3] = r[0];
        }

        function s(e, i) {
          return r[0] = e[i], r[1] = e[i + 1], r[2] = e[i + 2], r[3] = e[i + 3], t[0];
        }

        function a(e, i) {
          return r[3] = e[i], r[2] = e[i + 1], r[1] = e[i + 2], r[0] = e[i + 3], t[0];
        }

        e.writeFloatLE = i ? o : n, e.writeFloatBE = i ? n : o, e.readFloatLE = i ? s : a, e.readFloatBE = i ? a : s;
      }() : function () {
        function t(e, t, r, i) {
          var o = t < 0 ? 1 : 0;
          if (o && (t = -t), 0 === t) e(1 / t > 0 ? 0 : 2147483648, r, i);else if (isNaN(t)) e(2143289344, r, i);else if (t > 34028234663852886e22) e((o << 31 | 2139095040) >>> 0, r, i);else if (t < 11754943508222875e-54) e((o << 31 | Math.round(t / 1401298464324817e-60)) >>> 0, r, i);else {
            var n = Math.floor(Math.log(t) / Math.LN2);
            e((o << 31 | n + 127 << 23 | 8388607 & Math.round(t * Math.pow(2, -n) * 8388608)) >>> 0, r, i);
          }
        }

        function r(e, t, r) {
          var i = e(t, r),
              o = 2 * (i >> 31) + 1,
              n = i >>> 23 & 255,
              s = 8388607 & i;
          return 255 === n ? s ? NaN : o * (1 / 0) : 0 === n ? 1401298464324817e-60 * o * s : o * Math.pow(2, n - 150) * (s + 8388608);
        }

        e.writeFloatLE = t.bind(null, o), e.writeFloatBE = t.bind(null, n), e.readFloatLE = r.bind(null, s), e.readFloatBE = r.bind(null, a);
      }(), "undefined" != typeof Float64Array ? function () {
        var t = new Float64Array([-0]),
            r = new Uint8Array(t.buffer),
            i = 128 === r[7];

        function o(e, i, o) {
          t[0] = e, i[o] = r[0], i[o + 1] = r[1], i[o + 2] = r[2], i[o + 3] = r[3], i[o + 4] = r[4], i[o + 5] = r[5], i[o + 6] = r[6], i[o + 7] = r[7];
        }

        function n(e, i, o) {
          t[0] = e, i[o] = r[7], i[o + 1] = r[6], i[o + 2] = r[5], i[o + 3] = r[4], i[o + 4] = r[3], i[o + 5] = r[2], i[o + 6] = r[1], i[o + 7] = r[0];
        }

        function s(e, i) {
          return r[0] = e[i], r[1] = e[i + 1], r[2] = e[i + 2], r[3] = e[i + 3], r[4] = e[i + 4], r[5] = e[i + 5], r[6] = e[i + 6], r[7] = e[i + 7], t[0];
        }

        function a(e, i) {
          return r[7] = e[i], r[6] = e[i + 1], r[5] = e[i + 2], r[4] = e[i + 3], r[3] = e[i + 4], r[2] = e[i + 5], r[1] = e[i + 6], r[0] = e[i + 7], t[0];
        }

        e.writeDoubleLE = i ? o : n, e.writeDoubleBE = i ? n : o, e.readDoubleLE = i ? s : a, e.readDoubleBE = i ? a : s;
      }() : function () {
        function t(e, t, r, i, o, n) {
          var s = i < 0 ? 1 : 0;
          if (s && (i = -i), 0 === i) e(0, o, n + t), e(1 / i > 0 ? 0 : 2147483648, o, n + r);else if (isNaN(i)) e(0, o, n + t), e(2146959360, o, n + r);else if (i > 17976931348623157e292) e(0, o, n + t), e((s << 31 | 2146435072) >>> 0, o, n + r);else {
            var a;
            if (i < 22250738585072014e-324) e((a = i / 5e-324) >>> 0, o, n + t), e((s << 31 | a / 4294967296) >>> 0, o, n + r);else {
              var u = Math.floor(Math.log(i) / Math.LN2);
              1024 === u && (u = 1023), e(4503599627370496 * (a = i * Math.pow(2, -u)) >>> 0, o, n + t), e((s << 31 | u + 1023 << 20 | 1048576 * a & 1048575) >>> 0, o, n + r);
            }
          }
        }

        function r(e, t, r, i, o) {
          var n = e(i, o + t),
              s = e(i, o + r),
              a = 2 * (s >> 31) + 1,
              u = s >>> 20 & 2047,
              p = 4294967296 * (1048575 & s) + n;
          return 2047 === u ? p ? NaN : a * (1 / 0) : 0 === u ? 5e-324 * a * p : a * Math.pow(2, u - 1075) * (p + 4503599627370496);
        }

        e.writeDoubleLE = t.bind(null, o, 0, 4), e.writeDoubleBE = t.bind(null, n, 4, 0), e.readDoubleLE = r.bind(null, s, 0, 4), e.readDoubleBE = r.bind(null, a, 4, 0);
      }(), e;
    }

    function o(e, t, r) {
      t[r] = 255 & e, t[r + 1] = e >>> 8 & 255, t[r + 2] = e >>> 16 & 255, t[r + 3] = e >>> 24;
    }

    function n(e, t, r) {
      t[r] = e >>> 24, t[r + 1] = e >>> 16 & 255, t[r + 2] = e >>> 8 & 255, t[r + 3] = 255 & e;
    }

    function s(e, t) {
      return (e[t] | e[t + 1] << 8 | e[t + 2] << 16 | e[t + 3] << 24) >>> 0;
    }

    function a(e, t) {
      return (e[t] << 24 | e[t + 1] << 16 | e[t + 2] << 8 | e[t + 3]) >>> 0;
    }

    e.exports = i(i);
  }, function (e, t, r) {
    "use strict";

    e.exports = function (e, t) {
      var r = new Array(arguments.length - 1),
          i = 0,
          o = 2,
          n = !0;

      for (; o < arguments.length;) r[i++] = arguments[o++];

      return new Promise(function (o, s) {
        r[i] = function (e) {
          if (n) if (n = !1, e) s(e);else {
            for (var t = new Array(arguments.length - 1), r = 0; r < t.length;) t[r++] = arguments[r];

            o.apply(null, t);
          }
        };

        try {
          e.apply(t || null, r);
        } catch (e) {
          n && (n = !1, s(e));
        }
      });
    };
  }, function (e, t, r) {
    "use strict";

    function i() {
      this._listeners = {};
    }

    e.exports = i, i.prototype.on = function (e, t, r) {
      return (this._listeners[e] || (this._listeners[e] = [])).push({
        fn: t,
        ctx: r || this
      }), this;
    }, i.prototype.off = function (e, t) {
      if (void 0 === e) this._listeners = {};else if (void 0 === t) this._listeners[e] = [];else for (var r = this._listeners[e], i = 0; i < r.length;) r[i].fn === t ? r.splice(i, 1) : ++i;
      return this;
    }, i.prototype.emit = function (e) {
      var t = this._listeners[e];

      if (t) {
        for (var r = [], i = 1; i < arguments.length;) r.push(arguments[i++]);

        for (i = 0; i < t.length;) t[i].fn.apply(t[i++].ctx, r);
      }

      return this;
    };
  }, function (e, t, r) {
    "use strict";

    var i = e.exports,
        o = i.isAbsolute = function (e) {
      return /^(?:\/|\w+:)/.test(e);
    },
        n = i.normalize = function (e) {
      var t = (e = e.replace(/\\/g, "/").replace(/\/{2,}/g, "/")).split("/"),
          r = o(e),
          i = "";
      r && (i = t.shift() + "/");

      for (var n = 0; n < t.length;) ".." === t[n] ? n > 0 && ".." !== t[n - 1] ? t.splice(--n, 2) : r ? t.splice(n, 1) : ++n : "." === t[n] ? t.splice(n, 1) : ++n;

      return i + t.join("/");
    };

    i.resolve = function (e, t, r) {
      return r || (t = n(t)), o(t) ? t : (r || (e = n(e)), (e = e.replace(/(?:\/|^)[^/]+$/, "")).length ? n(e + "/" + t) : t);
    };
  }, function (e, t, r) {
    "use strict";

    var i = r(1);
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.default = void 0;

    var o,
        n,
        s,
        a,
        u = i(r(6)),
        p = (0, i(r(7)).default)(),
        l = "undefined" != typeof FormData,
        c = "undefined" != typeof Blob,
        h = (!1).overrideMimeType || !1,
        f = l,
        d = f || !1,
        y = c || h,
        m = function () {};

    Object.keys || (Object.keys = (o = Object.prototype.hasOwnProperty, n = !{
      toString: null
    }.propertyIsEnumerable("toString"), a = (s = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"]).length, function (e) {
      if ("object" !== (0, u.default)(e) && ("function" != typeof e || null === e)) throw new TypeError("Object.keys called on non-object");
      var t,
          r,
          i = [];

      for (t in e) o.call(e, t) && i.push(t);

      if (n) for (r = 0; r < a; r++) o.call(e, s[r]) && i.push(s[r]);
      return i;
    }));
    var g = {
      hasFormData: l,
      hasBlob: c,
      emptyfn: m,
      isCanSetRequestHeader: !0,
      hasOverrideMimeType: h,
      isCanUploadFileAsync: f,
      isCanUploadFile: d,
      isCanDownLoadFile: y,
      isSupportWss: !0,
      hasFlash: !1,
      xmlrequest: !1,
      stringify: function (e) {
        if ("undefined" != typeof JSON && JSON.stringify) return JSON.stringify(e);
        var t = "",
            r = [];
        return function e(i) {
          var o = !1;

          for (var n in "[object Array]" === Object.prototype.toString.call(i) ? (r.push("]", "["), o = !0) : "[object Object]" === Object.prototype.toString.call(i) && r.push("}", "{"), i) "[object Null]" === Object.prototype.toString.call(i[n]) ? i[n] = "null" : "[object Undefined]" === Object.prototype.toString.call(i[n]) && (i[n] = "undefined"), i[n] && "object" === (0, u.default)(i[n]) ? t += "," + (o ? "" : '"' + n + '":' + (o ? '"' : "")) + e(i[n]) : t += ',"' + (o ? "" : n + '":"') + i[n] + '"';

          return "" != t && (t = t.slice(1)), r.pop() + t + r.pop();
        }(e);
      },
      login: function (e) {
        var t = (e = e || {}).success || m,
            r = e.error || m,
            i = (e.appKey || "").split("#");
        if (2 !== i.length) return r({
          type: p.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR
        }), !1;
        var o = i[0],
            n = i[1],
            s = s || e.https,
            a = e.user || "",
            u = e.pwd || "",
            l = e.apiUrl,
            c = {
          grant_type: "password",
          username: a,
          password: u,
          timestamp: +new Date()
        };
        e = {
          url: l + "/" + o + "/" + n + "/token",
          dataType: "json",
          data: g.stringify(c),
          success: t,
          error: r
        };
        return g.ajax(e);
      },
      getFileUrl: function (e) {
        var t = {
          url: "",
          filename: "",
          filetype: "",
          data: ""
        },
            r = "string" == typeof e ? document.getElementById(e) : e;
        if (!g.isCanUploadFileAsync || !r) return t;

        try {
          if (window.URL.createObjectURL) {
            var i = r.files;

            if (i.length > 0) {
              var o = i.item(0);
              t.data = o, t.url = window.URL.createObjectURL(o), t.filename = o.name || "";
            }
          } else {
            o = document.getElementById(e).value;
            t.url = o;
            var n = o.lastIndexOf("/"),
                s = o.lastIndexOf("\\"),
                a = Math.max(n, s);
            t.filename = a < 0 ? o : o.substring(a + 1);
          }

          var u = t.filename.lastIndexOf(".");
          return -1 != u && (t.filetype = t.filename.substring(u + 1).toLowerCase()), t;
        } catch (e) {
          throw e;
        }
      },
      getFileSize: function (e) {
        var t = document.getElementById(e),
            r = 0;
        return t && t.files && t.files.length > 0 && (r = t.files[0].size), r;
      },
      trim: function (e) {
        return (e = "string" == typeof e ? e : "").trim ? e.trim() : e.replace(/^\s|\s$/g, "");
      },
      parseLink: function (e) {
        return e = e.replace(/(https?\:\/\/|www\.)([a-zA-Z0-9-]+(\.[a-zA-Z0-9]+)+)(\:[0-9]{2,4})?\/?((\.[:_0-9a-zA-Z-]+)|[:_0-9a-zA-Z-]*\/?)*\??[:_#@*&%0-9a-zA-Z-/=]*/gm, function (e) {
          return "<a href='" + (/^https?/gm.test(e) ? e : "//" + e) + "' target='_blank'>" + e + "</a>";
        });
      },
      parseJSON: function (e) {
        if (window.JSON && window.JSON.parse) return window.JSON.parse(e + "");
        var t,
            r = null,
            i = g.trim(e + "");
        return i && !g.trim(i.replace(/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g, function (e, i, o, n) {
          return t && i && (r = 0), 0 === r ? e : (t = o || i, r += !n - !o, "");
        })) ? Function("return " + i)() : Function("Invalid JSON: " + e)();
      },
      parseUploadResponse: function (e) {
        return e.indexOf("callback") > -1 ? e.slice(9, -1) : e;
      },
      parseDownloadResponse: function (e) {
        return e && e.type && "application/json" === e.type || 0 > Object.prototype.toString.call(e).indexOf("Blob") ? this.url + "?token=" : window.URL.createObjectURL(e);
      },
      uploadFile: function (e) {
        (e = e || {}).onFileUploadProgress = e.onFileUploadProgress || m, e.onFileUploadComplete = e.onFileUploadComplete || m, e.onFileUploadError = e.onFileUploadError || m, e.onFileUploadCanceled = e.onFileUploadCanceled || m;
        var t = e.accessToken || this.context.accessToken;

        if (t) {
          var r,
              i,
              o,
              n = e.appKey || this.context.appKey || "";

          if (n && (r = (o = n.split("#"))[0], i = o[1]), r || i) {
            var s = e.apiUrl;
            this.isHttpDNS && (s = this.apiUrl);
            var a = e.uploadUrl || s + "/" + r + "/" + i + "/chatfiles";
            if (g.isCanUploadFileAsync) {
              if ((e.file.data ? e.file.data.size : void 0) <= 0) e.onFileUploadError({
                type: p.WEBIM_UPLOADFILE_ERROR,
                id: e.id
              });else {
                var u = g.xmlrequest();
                u.upload && u.upload.addEventListener("progress", e.onFileUploadProgress, !1), u.addEventListener ? (u.addEventListener("abort", e.onFileUploadCanceled, !1), u.addEventListener("load", function (t) {
                  try {
                    var r = g.parseJSON(u.responseText);

                    try {
                      e.onFileUploadComplete(r);
                    } catch (t) {
                      e.onFileUploadError({
                        type: p.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,
                        data: t
                      });
                    }
                  } catch (t) {
                    e.onFileUploadError({
                      type: p.WEBIM_UPLOADFILE_ERROR,
                      data: u.responseText,
                      id: e.id,
                      xhr: u
                    });
                  }
                }, !1), u.addEventListener("error", function (t) {
                  e.onFileUploadError({
                    type: p.WEBIM_UPLOADFILE_ERROR,
                    id: e.id,
                    xhr: u
                  });
                }, !1)) : u.onreadystatechange && (u.onreadystatechange = function () {
                  if (4 === u.readyState) {
                    if (200 === ajax.status) try {
                      var t = g.parseJSON(u.responseText);
                      e.onFileUploadComplete(t);
                    } catch (t) {
                      e.onFileUploadError({
                        type: p.WEBIM_UPLOADFILE_ERROR,
                        data: u.responseText,
                        id: e.id,
                        xhr: u
                      });
                    } else e.onFileUploadError({
                      type: p.WEBIM_UPLOADFILE_ERROR,
                      data: u.responseText,
                      id: e.id,
                      xhr: u
                    });
                  } else u.abort(), e.onFileUploadCanceled();
                }), u.open("POST", a), u.setRequestHeader("restrict-access", "true"), u.setRequestHeader("Accept", "*/*"), u.setRequestHeader("Authorization", "Bearer " + t);
                var l = new FormData();
                l.append("file", e.file.data), window.XDomainRequest && (u.readyState = 2), u.send(l);
              }
            } else g.hasFlash && "function" == typeof e.flashUpload ? e.flashUpload && e.flashUpload(a, e) : e.onFileUploadError({
              type: p.WEBIM_UPLOADFILE_BROWSER_ERROR,
              id: e.id
            });
          } else e.onFileUploadError({
            type: p.WEBIM_UPLOADFILE_ERROR,
            id: e.id
          });
        } else e.onFileUploadError({
          type: p.WEBIM_UPLOADFILE_NO_LOGIN,
          id: e.id
        });
      },
      download: function (e) {
        e.onFileDownloadComplete = e.onFileDownloadComplete || m, e.onFileDownloadError = e.onFileDownloadError || m;
        var t = e.accessToken || this.context.accessToken,
            r = g.xmlrequest();

        if (t) {
          if (g.isCanDownLoadFile) {
            "addEventListener" in r ? (r.addEventListener("load", function (t) {
              e.onFileDownloadComplete(r.response, r);
            }, !1), r.addEventListener("error", function (t) {
              e.onFileDownloadError({
                type: p.WEBIM_DOWNLOADFILE_ERROR,
                id: e.id,
                xhr: r
              });
            }, !1)) : "onreadystatechange" in r && (r.onreadystatechange = function () {
              4 === r.readyState ? 200 === ajax.status ? e.onFileDownloadComplete(r.response, r) : e.onFileDownloadError({
                type: p.WEBIM_DOWNLOADFILE_ERROR,
                id: e.id,
                xhr: r
              }) : (r.abort(), e.onFileDownloadError({
                type: p.WEBIM_DOWNLOADFILE_ERROR,
                id: e.id,
                xhr: r
              }));
            });
            var i = e.method || "GET",
                o = e.responseType || "blob",
                n = e.mimeType || "text/plain; charset=x-user-defined";
            r.open(i, e.url), "undefined" != typeof Blob ? r.responseType = o : r.overrideMimeType(n);
            var s = {
              "X-Requested-With": "XMLHttpRequest",
              Accept: "application/octet-stream",
              "share-secret": e.secret,
              Authorization: "Bearer " + t
            },
                a = e.headers || {};

            for (var u in a) s[u] = a[u];

            for (var u in s) s[u] && r.setRequestHeader(u, s[u]);

            window.XDomainRequest && (r.readyState = 2), r.send(null);
          } else e.onFileDownloadComplete();
        } else e.onFileDownloadError({
          type: p.WEBIM_DOWNLOADFILE_NO_LOGIN,
          id: e.id
        });
      },
      parseTextMessage: function (e, t) {
        if ("string" == typeof e) {
          if ("[object Object]" !== Object.prototype.toString.call(t)) return {
            isemoji: !1,
            body: [{
              type: "txt",
              data: e
            }]
          };
          var r = e,
              i = [],
              o = r.match(/\[[^[\]]{2,3}\]/gm);
          if (!o || o.length < 1) return {
            isemoji: !1,
            body: [{
              type: "txt",
              data: e
            }]
          };

          for (var n = !1, s = 0; s < o.length; s++) {
            var a = r.substring(0, r.indexOf(o[s])),
                u = t.map[o[s]];

            if (a && i.push({
              type: "txt",
              data: a
            }), u) {
              var p = t.map ? t.path + u : null;
              p ? (n = !0, i.push({
                type: "emoji",
                data: p
              })) : i.push({
                type: "txt",
                data: o[s]
              });
              var l = r.indexOf(o[s]) + o[s].length;
              r = r.substring(l);
            } else i.push({
              type: "txt",
              data: o[s]
            });
          }

          return r && i.push({
            type: "txt",
            data: r
          }), n ? {
            isemoji: n,
            body: i
          } : {
            isemoji: !1,
            body: [{
              type: "txt",
              data: e
            }]
          };
        }
      },
      ajax: function (e) {
        var t = e.success || m,
            r = e.error || m,
            i = e.type || "POST",
            o = e.data || null,
            n = "";

        if ("get" === i.toLowerCase() && o) {
          for (var s in o) o.hasOwnProperty(s) && (n += s + "=" + o[s] + "&");

          n = n ? n.slice(0, -1) : n, e.url += (e.url.indexOf("?") > 0 ? "&" : "?") + (n ? n + "&" : n) + "_v=" + new Date().getTime(), o = null, n = null;
        }

        uni.request({
          url: e.url,
          data: e.data,
          header: e.headers,
          method: i,
          success: function (e) {
            "200" == e.statusCode ? t(e.data) : r(e);
          },
          complete: function () {},
          fail: function (e) {
            r(e);
          }
        });
      },
      ts: function () {
        var e = new Date(),
            t = e.getHours(),
            r = e.getMinutes(),
            i = e.getSeconds();
        return (t < 10 ? "0" + t : t) + ":" + (r < 10 ? "0" + r : r) + ":" + (i < 10 ? "0" + i : i) + ":" + e.getMilliseconds() + " ";
      },
      getObjectKey: function (e, t) {
        for (var r in e) if (e[r] == t) return r;

        return "";
      },
      sprintf: function () {
        var e,
            t,
            r = arguments,
            i = r[0] || "";

        for (e = 1, t = r.length; e < t; e++) i = i.replace(/%s/, r[e]);

        return i;
      },
      reverse: function (e) {
        var t = [];
        if (Array.prototype.reverse) t = e.reverse();else for (var r = 0; r < e.length; r++) t.unshift(e[r]);
        return t;
      },
      getEnv: function () {
        var e = !0;

        try {
          e = !window || !navigator;
        } catch (t) {
          e = !0;
        }

        return e;
      },
      checkArray: function (e, t) {
        var r = "off";
        if (e.forEach(function (e, i) {
          if (e.name === t.name) return r = "on", i;
        }), "off" == r) return !1;
      },
      _listenNetwork: function (e, t) {}
    },
        v = g;
    t.default = v;
  }]);
});